Add a value into the database queue to be delivered to the queue
listener via Deno.Kv.listenQueue
.
const db = await Deno.openKv();
await db.enqueue("bar");
The delay
option can be used to specify the delay (in milliseconds)
of the value delivery. The default delay is 0, which means immediate
delivery.
const db = await Deno.openKv();
await db.enqueue("bar", { delay: 60000 });
The keysIfUndelivered
option can be used to specify the keys to
be set if the value is not successfully delivered to the queue
listener after several attempts. The values are set to the value of
the queued message.
const db = await Deno.openKv();
await db.enqueue("bar", { keysIfUndelivered: [["foo", "bar"]] });
Parameters
optional
options: { delay?: number; keysIfUndelivered?: Deno.KvKey[]; }Returns
Promise<KvCommitResult>