Skip to main content
Version: Next

StorageWritePolicy

Per-storage-type write policy of a StorageTransaction. Datasets and key-value stores are always deferred and not configurable — deferring is the only safe mode for non-idempotent writes, and withDirectStorageAccess covers one-off immediate writes.

Index

Properties

Properties

requestQueue

requestQueue: StorageWriteMode

Write mode for request queue additions. Note that this is a write policy for the queue, not the queue instance itself (which is the top-level requestQueue crawler option).

  • writeThrough (default): requests are added immediately and are not rolled back with the transaction. This is safe (additions are deduplicated by uniqueKey, so a retry is idempotent) and keeps new requests visible to the crawler while the handler still runs.
  • deferred: requests are only added when the transaction commits — strict all-or-nothing semantics, at the cost of the crawler not seeing them until the handler finishes.
Page Options