Skip to main content
Version: v1

IConsensusOrderedCollectionEvents Interface

Events notifying about addition, acquisition, release and completion of items

Signature

export interface IConsensusOrderedCollectionEvents<T> extends ISharedObjectEvents

Extends: ISharedObjectEvents

Type Parameters

Parameter Description
T

Call Signatures

CallSignature Description
(event: "add", listener: (value: T, newlyAdded: boolean) => void): this Event fires when new item is added to the queue or an item previously acquired is returned back to a queue (including client loosing connection)
(event: "acquire", listener: (value: T, clientId?: string) => void): this Event fires when a client acquired an item Fires both for locally acquired items, as well as items acquired by remote clients
(event: "complete", listener: (value: T) => void): this "Complete event fires when a client completes an item.
(event: "localRelease", listener: (value: T, intentional: boolean) => void): this Event fires when locally acquired item is being released back to the queue. Please note that release process is asynchronous, so it takes a while for it to happen ("add" event will be fired as result of it)

Call Signature Details

(event: "add", listener: (value: T, newlyAdded: boolean) => void): this

Event fires when new item is added to the queue or an item previously acquired is returned back to a queue (including client loosing connection)

Signature

(event: "add", listener: (value: T, newlyAdded: boolean) => void): this;

(event: "acquire", listener: (value: T, clientId?: string) => void): this

Event fires when a client acquired an item Fires both for locally acquired items, as well as items acquired by remote clients

Signature

(event: "acquire", listener: (value: T, clientId?: string) => void): this;

(event: "complete", listener: (value: T) => void): this

"Complete event fires when a client completes an item.

Signature

(event: "complete", listener: (value: T) => void): this;

(event: "localRelease", listener: (value: T, intentional: boolean) => void): this

Event fires when locally acquired item is being released back to the queue. Please note that release process is asynchronous, so it takes a while for it to happen ("add" event will be fired as result of it)

Signature

(event: "localRelease", listener: (value: T, intentional: boolean) => void): this;