createQueue API
API reference for the createQueue composable.
(_options?: QueueOptions) => RCreates a new queue instance
(_options?: QueueContextOptions) => ContextTrinity<R>Creates a new queue context.
(namespace?: string) => RReturns the current queue instance.
booleanEnable event emission for registry operations
Default: false
booleanEnable reactive behavior for registry operations
Default: false
numberDefault timeout in milliseconds for tickets without explicit timeout
Default: 3000
ReadonlyMap<ID, Z>The collection of tickets in the registry
numberThe number of tickets in the registry
() => voidClear the entire registry
(id: ID) => booleanCheck if a ticket exists by ID
() => readonly ID[]Get all registered IDs
(value: Z["value"]) => ID[] | undefinedBrowse for an ID(s) by value
(index: number) => ID | undefinedlookup a ticket by index number
(id: ID) => Z | undefinedGet a ticket by ID
(id: ID, ticket?: Partial<Z>) => ZUpdate or insert a ticket by ID
() => readonly Z[]Get all values of registered tickets
() => readonly [ID, Z][]Get all entries of registered tickets
() => voidReset the index directory and update all tickets
(direction?: "first" | "last", from?: number, predicate?: (ticket) => boolean) => Z | undefinedSeek for a ticket based on direction and optional predicate
<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<Z, K>) => voidListen for registry events
<K extends Extensible<RegistryEventName>>(event: K, cb: EventHandler<Z, K>) => voidStop listening for registry events
<K extends Extensible<RegistryEventName>>(event: K, data: EventPayload<Z, K>) => voidEmit an event with data
() => voidClears the registry and removes all listeners
(registrations: Partial<Z>[]) => Z[]Onboard multiple tickets at once
<R>(fn: () => R) => RExecute operations in a batch, deferring cache invalidation and event emission until complete
(ticket?: Partial<Z>) => ERegister a new ticket in the queue (accepts input type, returns output type)
(id?: ID) => E | undefinedUnregister a ticket from the queue
() => E | undefinedPause the timeout of the first ticket in the queue
() => E | undefinedResume the timeout of the first paused ticket in the queue
(ids: ID[]) => voidBatch unregister tickets from the queue