Show / Hide Table of Contents

Class QueueAsyncChunkHandler<TWorkItem, TChunkProcessor>

Owner of the thread processing the queue on behalf of .

Inheritance
Object
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>
QueueAsyncChunkHandler<TWorkItem, TChunkProcessor>
Inherited Members
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.ToString()
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.OnSetup(Queue<TWorkItem>)
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.SynchronousSetup(Queue<TWorkItem>)
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.AsynchronousOperation()
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.ScheduleNewWork()
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.ExecuteWork()
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.Processor
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.WasSetupCalled
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.HasWorkToDo
AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>>.ThreadName
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public class QueueAsyncChunkHandler<TWorkItem, TChunkProcessor> : AsynchronousHandler<TChunkProcessor, Queue<TWorkItem>> where TChunkProcessor : QueueAsyncChunkProcessor<TWorkItem>, new()
Type Parameters
Name Description
TWorkItem

The type that is in the queue

TChunkProcessor

The processor that processes a chunk of the queue.

Remarks

The handler is designed to be used with and uses the to perform the actuall processing on the queue. All implementations need a default parameter-less constructor.

Constructors

QueueAsyncChunkHandler()

Default constructor

Declaration
public QueueAsyncChunkHandler()
Remarks

The handler is designed to be used with and uses the to perform the actuall processing on the queue. All implementations need a default parameter-less constructor.

Properties

QueueLength

Obtain the length of the queue

Declaration
public int QueueLength { get; }
Property Value
Type Description
Int32
Remarks

The handler is designed to be used with and uses the to perform the actuall processing on 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 handler is designed to be used with and uses the to perform the actuall processing on the queue. All implementations need a default parameter-less constructor.

ScheduleNewWork()

Start the thread and start processing the chunk.

Declaration
protected override void ScheduleNewWork()
Overrides
SuperOffice.Threading.AsynchronousHandler<TChunkProcessor, System.Collections.Generic.Queue<TWorkItem>>.ScheduleNewWork()
Remarks

The handler is designed to be used with and uses the to perform the actuall processing on the queue. All implementations need a default parameter-less constructor.

ThreadDelegate(AsyncContext, Object)

The actual thread perform processing.

Declaration
protected void ThreadDelegate(AsyncContext context, object argument)
Parameters
Type Name Description
AsyncContext context

Context of the thread.

Object argument

Unused empty argument.

Remarks

The handler is designed to be used with and uses the to perform the actuall processing on the queue. All implementations need a default parameter-less constructor.

Extension Methods

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