@sovereignbase/storage
    Preparing search index...

    Class WriteQueue

    Persistent FIFO of remote store and delete operations.

    Index
    onQueued: () => void

    Called after an operation has been committed to the queue.

    • Returns the oldest operation without removing it.

      Call finalize only after the corresponding remote write succeeds. An operation remains at the head of the queue until finalized.

      Returns Promise<
          { finalize: () => Promise<void>; operation: WriteOperation }
          | undefined,
      >

      StorageError with code INDEXEDDB_OPEN_FAILED or WRITE_QUEUE_DEQUEUE_FAILED. The returned finalize function can reject with WRITE_QUEUE_FINALIZE_FAILED. The original IndexedDB error is retained as cause.

    • Adds an operation to the end of the queue, replacing any pending operations for the same URL.

      Parameters

      Returns Promise<void>

      StorageError with code INDEXEDDB_OPEN_FAILED or WRITE_QUEUE_ENQUEUE_FAILED; the original IndexedDB error is retained as cause.

    • Returns the number of pending operations.

      Returns Promise<number>

      StorageError with code INDEXEDDB_OPEN_FAILED or WRITE_QUEUE_SIZE_FAILED; the original IndexedDB error is retained as cause.