Skip to main content
method Deno.Kv.prototype.listenQueue

Listen for queue values to be delivered from the database queue, which were enqueued with Deno.Kv.enqueue. The provided handler callback is invoked on every dequeued value. A failed callback invocation is automatically retried multiple times until it succeeds or until the maximum number of retries is reached.

const db = await Deno.openKv();
db.listenQueue(async (msg: unknown) => {
  await db.set(["foo"], msg);


handler: (value: any) => Promise<void> | void