createQueue API
API reference for the createQueue composable.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| createQueue | Registration |
| createRegistry | Registration |
| createTimeline | Registration |
Functions
createQueue
(_options?: QueueOptions) => QueueContext<QueueTicketInput<unknown>, QueueTicket<QueueTicketInput<unknown>>>Creates a new queue instance
createQueueContext
(_options?: QueueContextOptions) => ContextTrinity<QueueContext<QueueTicketInput<unknown>, QueueTicket<QueueTicketInput<unknown>>>>Creates a new queue context.
useQueue
(namespace?: string) => QueueContext<QueueTicketInput<unknown>, QueueTicket<QueueTicketInput<unknown>>>Returns the current queue instance.
Options
timeout
number | undefinedDefault timeout in milliseconds for tickets without explicit timeout
Default: 3000
Properties
Methods
move
(id: ID, toIndex: number) => E | undefinedSeek for a ticket based on direction and optional predicate
seek
(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => E | undefinedon
<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<E, K>) => voidListen for registry events
off
<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<E, K>) => voidStop listening for registry events
emit
<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<E, K>) => voidEmit an event with data
batch
<R>(fn: () => R) => RExecute operations in a batch, deferring cache invalidation and event emission until complete
register
(ticket?: Partial<Z>) => ERegister a new ticket in the queue (accepts input type, returns output type)