Packages > @fluidframework/container-definitions > IDeltaQueue

IDeltaQueue Interface

Queue of ops to be sent to or processed from storage

Signature

/** @sealed */
export interface IDeltaQueue<T> extends IEventProvider<IDeltaQueueEvents<T>>, IDisposable

Extends: IEventProvider <IDeltaQueueEvents <T>>, IDisposable

Type Parameters

Parameter Description
T

Properties

Property Type Description
idle boolean Flag indicating whether or not the queue is idle. I.e. there are no remaining messages to processes.
length number The number of messages remaining in the queue
paused boolean Flag indicating whether or not the queue was paused

Methods

Method Return Type Description
pause() Promise<void> Pauses processing on the queue.
peek() T | undefined Peeks at the next message in the queue
resume() void Resumes processing on the queue
toArray() T[] Returns all the items in the queue as an array. Does not remove them from the queue.
waitTillProcessingDone() Promise<{ count: number; duration: number; }> returns number of ops processed and time it took to process these ops. Zeros if queue did not process anything (had no messages, was paused or had hit an error before)

Property Details

idle

Flag indicating whether or not the queue is idle. I.e. there are no remaining messages to processes.

Signature

idle: boolean;

length

The number of messages remaining in the queue

Signature

length: number;

paused

Flag indicating whether or not the queue was paused

Signature

paused: boolean;

Method Details

pause

Pauses processing on the queue.

Signature

pause(): Promise<void>;

Returns

A promise which resolves when processing has been paused.

Return type: Promise<void>

peek

Peeks at the next message in the queue

Signature

peek(): T | undefined;

Returns

Return type: T | undefined

resume

Resumes processing on the queue

Signature

resume(): void;

toArray

Returns all the items in the queue as an array. Does not remove them from the queue.

Signature

toArray(): T[];

Returns

Return type: T[]

waitTillProcessingDone

returns number of ops processed and time it took to process these ops. Zeros if queue did not process anything (had no messages, was paused or had hit an error before)

Signature

waitTillProcessingDone(): Promise<{
        count: number;
        duration: number;
    }>;

Returns

Return type: Promise<{ count: number; duration: number; }>