Interface IAsyncQueue<TItem>
Inherited Members
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public interface IAsyncQueue<TItem> : IAsyncQueueBase<TItem>
Type Parameters
Name | Description |
---|---|
TItem |
Methods
Enqueue(TItem)
Enqueue an item to the queue
Declaration
void Enqueue(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item |
Requeue(IAsyncQueueProcessItemContext<TItem>)
Add back the item currently being processed to the end of queue, for a retry attempt
Declaration
void Requeue(IAsyncQueueProcessItemContext<TItem> context)
Parameters
Type | Name | Description |
---|---|---|
IAsyncQueueProcessItemContext<TItem> | context | Context that needs the be requeued |
Remarks
This method is intended to be called from within the AsyncQueueProcessItemAsync<TItem> delegate. When an item is being processed, it is removed from the queue and added to a currently being processed list. When processing has been completed, it is removed from this list as well. When WaitForItemsInQueueToBeProcessedAsync is calledm, it waits for all items in the queue and items being processed. We thus need to add the item back in the queue, without the internal signaling task comleting, so we ignore retry attempts when waiting.