Skip to content

IDurableQueue<T> Methods

Represents a first-in, first-out collection whose mutations are recorded in a journal.

Clear

abstract
public abstract void Clear()
Removes all elements from the queue.

Contains(T)

abstract
public abstract bool Contains(T item)
Determines whether the queue contains the specified element.

Parameters

itemT
The element to locate in the queue.

Returns

true if the queue contains item; otherwise, false.

CopyTo(T[], int)

abstract
public abstract void CopyTo(T[] array, int arrayIndex)
Copies the queue elements to an array, starting at the specified array index.

Parameters

arrayT[]
The destination array.
arrayIndexint
The zero-based index in array at which copying begins.

Dequeue

abstract
public abstract T Dequeue()
Removes and returns the element at the beginning of the queue.

Returns

The element removed from the beginning of the queue.

Enqueue(T)

abstract
public abstract void Enqueue(T item)
Adds an element to the end of the queue.

Parameters

itemT
The element to add to the queue.

Peek

abstract
public abstract T Peek()
Returns the element at the beginning of the queue without removing it.

Returns

The element at the beginning of the queue.

TryDequeue(T)

abstract
public abstract bool TryDequeue(out T item)
Attempts to remove and return the element at the beginning of the queue.

Parameters

itemT
The removed element, or the default value of T when the queue is empty.

Returns

true if an element was removed; otherwise, false.

TryPeek(T)

abstract
public abstract bool TryPeek(out T item)
Attempts to return the element at the beginning of the queue without removing it.

Parameters

itemT
The element at the beginning of the queue, or the default value of T when the queue is empty.

Returns

true if an element was returned; otherwise, false.