AsyncBatchedStore extends BaseStore to provide batched operations for list and put methods. It queues operations and processes them in batches for improved efficiency. This store is designed to run for the full duration of the process, or until stop() is called.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Constructors

Properties

processBatchQueue: any

Runs the task that processes queued operations in batches. This method runs continuously until the store is stopped, or the process is terminated.

Returns

A promise that resolves when the task is complete.

queue: any

A queue of operations to be processed in batch.

running: any

Whether or not the batched processing is currently running.

Default

{false}
store: any

The store to batch operations for.

Accessors

  • get isRunning(): boolean
  • Returns boolean

Methods

  • Queues a list operation to be processed in batch.

    Parameters

    • prefixes: string[]

      An array of prefixes to list.

    Returns Promise<Record<string, Record<string, Values>>>

    A promise that resolves with the list results.

  • Queues a put operation to be processed in batch.

    Parameters

    • writes: [string, string, null | Values][]

      An array of write operations to be performed.

    Returns Promise<void>

    A promise that resolves when the put operation is complete.

  • Start running the batched processing of operations. This process will run continuously until the store is stopped, which can be done by calling the stop() method.

    Returns void

  • Stops the batched processing of operations.

    Returns void