Show / Hide Table of Contents

Interface IDelayedAsyncQueue<TItem>

Interface implemented by NetServer's AsyncQueue

Inherited Members
IAsyncQueueBase<DelayedItem<TItem>>.WaitForItemsInQueueToBeProcessedAsync(CancellationToken)
IAsyncQueueBase<DelayedItem<TItem>>.ProcessItemsAsync(AsyncQueueProcessItemAsync<DelayedItem<TItem>>, CancellationToken)
IAsyncQueueBase<DelayedItem<TItem>>.ProcessNextItemAsync(AsyncQueueProcessItemAsync<DelayedItem<TItem>>, CancellationToken)
IAsyncQueueBase<DelayedItem<TItem>>.ToArray(bool)
IAsyncQueueBase<DelayedItem<TItem>>.HasItemsInTheQueue
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public interface IDelayedAsyncQueue<TItem> : IAsyncQueueBase<DelayedItem<TItem>>
Type Parameters
Name Description
TItem

Item to add to the queue

Methods

Enqueue(TItem, Task)

Enwueue an item to the queue, and schedule it to be executed after a prerequisite task is completed.

Declaration
void Enqueue(TItem item, Task prerequisiteTask)
Parameters
Type Name Description
TItem item

Item to be processed.

Task prerequisiteTask

Task that must be completed before the item is processed.

Enqueue(TItem, TimeSpan)

Interface implemented by NetServer's AsyncQueue

Declaration
void Enqueue(TItem item, TimeSpan delay)
Parameters
Type Name Description
TItem item
TimeSpan delay

Requeue(IAsyncQueueProcessItemContext<DelayedItem<TItem>>, Task)

Add back the item being processed to the end of queue, for a retry attempt

Declaration
void Requeue(IAsyncQueueProcessItemContext<DelayedItem<TItem>> context, Task prerequisiteTask)
Parameters
Type Name Description
IAsyncQueueProcessItemContext<DelayedItem<TItem>> context

Context that needs the be requeued

Task prerequisiteTask

Task that must be completed before the item is processed again.

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.

Requeue(IAsyncQueueProcessItemContext<DelayedItem<TItem>>, TimeSpan)

Interface implemented by NetServer's AsyncQueue

Declaration
void Requeue(IAsyncQueueProcessItemContext<DelayedItem<TItem>> context, TimeSpan delay)
Parameters
Type Name Description
IAsyncQueueProcessItemContext<DelayedItem<TItem>> context
TimeSpan delay

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top