Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Classes
Implementation of the KvStore interface for Cloudflare Workers KV binding. This class provides a wrapper around Cloudflare's KV namespace to store and retrieve JSON-serializable values using structured keys.
- delete(key: KvKey): Promise<void>No documentation available
- get<T = unknown>(key: KvKey): Promise<T | undefined>No documentation available
- list(prefix?: KvKey): AsyncIterable<KvStoreListEntry>
{@inheritDoc KvStore.list}
- set(): Promise<void>key: KvKey,value: unknown,options?: KvStoreSetOptionsNo documentation available
Implementation of the MessageQueue interface for Cloudflare Workers Queues binding. This class provides a wrapper around Cloudflare's Queues to send messages to a queue.
- enqueue(): Promise<void>message: any,options?: MessageQueueEnqueueOptionsNo documentation available
- enqueueMany(): Promise<void>messages: readonly any[],options?: MessageQueueEnqueueOptionsNo documentation available
- listen(): Promise<void>_handler: (message: any) => Promise<void> | void,_options?: MessageQueueListenOptionsNo documentation available
- nativeRetrial: boolean
Cloudflare Queues provide automatic retry with exponential backoff and Dead Letter Queues.
- processMessage(rawMessage: any): Promise<ProcessMessageResult>
Processes a message from the queue, handling ordering key locks. Call this method before Federation.processQueuedTask to ensure ordering key semantics are respected.
Interfaces
Result from WorkersMessageQueue.processMessage.
- message: any
The unwrapped message payload to process. Only present when
shouldProcessistrue. - release: () => Promise<void>
A cleanup function that must be called after processing the message. This releases the ordering key lock. Only present when
shouldProcessistrueand the message had an ordering key. - shouldProcess: boolean
Whether the message should be processed. If
false, the message has not been processed (for example, because an ordering key lock is still held) and the caller is responsible for re-enqueuing or retrying it when appropriate.
Minimal Cloudflare Workers KV binding shape used by this package.
Compatible with both @cloudflare/workers-types and wrangler types
generated declarations.
- delete(key: Key): Promise<void>No documentation available
- get(key: Key): Promise<string | null>No documentation available
- getWithMetadata<Metadata = unknown>(key: Key): Promise<WorkersKvNamespaceGetWithMetadataResult<string, Metadata>>No documentation available
- list<Metadata = unknown>(options?: WorkersKvNamespaceListOptions): Promise<WorkersKvNamespaceListResult<Metadata, Key>>No documentation available
- put(): Promise<void>key: Key,value: string,options?: WorkersKvNamespacePutOptionsNo documentation available
Options for WorkersMessageQueue.
- orderingKeyPrefix: string
The prefix for ordering key lock keys. Defaults to
"__fedify_ordering_". - orderingKv: WorkersKvNamespaceLike<string>
The KV namespace to use for ordering key locks. If not provided, ordering keys will not be supported.
- orderingLockTtl: number
The TTL (time-to-live) for ordering key locks in seconds. Defaults to 60 seconds. Must be at least 60 seconds due to Cloudflare KV minimum TTL requirement.