interface IQueueProducer
Since 0.2.0

A Cloudflare Queues producer binding.

The consumer half is IQueueMessageBatch, dispatched by the handler createQueueHandler builds for the Worker's queue export.

Methods

send(
body: unknown,
): Promise<void>

Enqueues one message, at most 128 KB.

sendBatch(messages: readonly { readonly body: unknown; readonly contentType?: string; }[]): Promise<void>

Enqueues up to 100 messages, at most 256 KB in total.

Usage

import { type IQueueProducer } from "cloudflare-plugin/src/index.ts";