Class QueueAsyncChunkProcessor<TWorkItem>
Base class for implementing a processor working on chunks of a queue.
Inherited Members
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public abstract class QueueAsyncChunkProcessor<TWorkItem> : AsynchronousHandlerProcessor<Queue<TWorkItem>>
Type Parameters
| Name | Description |
|---|---|
| TWorkItem | The type that is in the queue |
Remarks
The processor is designed to be used with
Constructors
QueueAsyncChunkProcessor()
Base class for implementing a processor working on chunks of a queue.
Declaration
protected QueueAsyncChunkProcessor()
Remarks
The processor is designed to be used with
Properties
HasWorkToDo
Check if there are more work in the queue chunk to be processed.
Declaration
public override bool HasWorkToDo { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Overrides
Remarks
The processor is designed to be used with
QueueLength
Obtain the length of the queue
Declaration
public int QueueLength { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Remarks
The processor is designed to be used with
Methods
Enqueue(TWorkItem)
Add a work item to the queue for processing.
Declaration
public bool Enqueue(TWorkItem workItem)
Parameters
| Type | Name | Description |
|---|---|---|
| TWorkItem | workItem | The item to add to the queue for processing. |
Returns
| Type | Description |
|---|---|
| Boolean | True if successfully added to the queue. False if the chunk processor has completed processed its queue and has or is about to die. |
Remarks
The processor is designed to be used with
ExecuteWork()
Perform the actuall processing of the queue. ExecuteWorkOnWorkItem(TWorkItem) is called to process each item in the queue
Declaration
public override void ExecuteWork()
Overrides
Remarks
The processor is designed to be used with
ExecuteWorkOnWorkItem(TWorkItem)
Base class for implementing a processor working on chunks of a queue.
Declaration
protected abstract void ExecuteWorkOnWorkItem(TWorkItem workItem)
Parameters
| Type | Name | Description |
|---|---|---|
| TWorkItem | workItem |
Remarks
The processor is designed to be used with