Show / Hide Table of Contents

Class QueueAsyncChunkProcessor<TWorkItem>

Base class for implementing a processor working on chunks of a queue.

Inheritance
Object
AsynchronousHandlerProcessor<Queue<TWorkItem>>
QueueAsyncChunkProcessor<TWorkItem>
Inherited Members
AsynchronousHandlerProcessor<Queue<TWorkItem>>.OnSetup(Queue<TWorkItem>)
AsynchronousHandlerProcessor<Queue<TWorkItem>>.Argument
AsynchronousHandlerProcessor<Queue<TWorkItem>>.ThreadName
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 and will dirrectly be used by . Implementers of the processor needs to implement the method ExecuteWorkOnWorkItem(TWorkItem) to process each induvidual item in the queue. All implementations need a default parameter-less constructor.

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 and will dirrectly be used by . Implementers of the processor needs to implement the method ExecuteWorkOnWorkItem(TWorkItem) to process each induvidual item in the queue. All implementations need a default parameter-less constructor.

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
SuperOffice.Threading.AsynchronousHandlerProcessor<System.Collections.Generic.Queue<TWorkItem>>.HasWorkToDo
Remarks

The processor is designed to be used with and will dirrectly be used by . Implementers of the processor needs to implement the method ExecuteWorkOnWorkItem(TWorkItem) to process each induvidual item in the queue. All implementations need a default parameter-less constructor.

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 and will dirrectly be used by . Implementers of the processor needs to implement the method ExecuteWorkOnWorkItem(TWorkItem) to process each induvidual item in the queue. All implementations need a default parameter-less constructor.

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 and will dirrectly be used by . Implementers of the processor needs to implement the method ExecuteWorkOnWorkItem(TWorkItem) to process each induvidual item in the queue. All implementations need a default parameter-less constructor.

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
SuperOffice.Threading.AsynchronousHandlerProcessor<System.Collections.Generic.Queue<TWorkItem>>.ExecuteWork()
Remarks

The processor is designed to be used with and will dirrectly be used by . Implementers of the processor needs to implement the method ExecuteWorkOnWorkItem(TWorkItem) to process each induvidual item in the queue. All implementations need a default parameter-less constructor.

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 and will dirrectly be used by . Implementers of the processor needs to implement the method ExecuteWorkOnWorkItem(TWorkItem) to process each induvidual item in the queue. All implementations need a default parameter-less constructor.

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