Class QueuedThreadBase<TAsynchronousHandlerProcessor, TAsynchronousArgument>
This class is a base class for execution strategies that queue asynchronous work.
Inheritance
Inherited Members
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public abstract class QueuedThreadBase<TAsynchronousHandlerProcessor, TAsynchronousArgument> : AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument> where TAsynchronousHandlerProcessor : AsynchronousHandlerProcessor<TAsynchronousArgument>, new()
where TAsynchronousArgument : class
Type Parameters
| Name | Description |
|---|---|
| TAsynchronousHandlerProcessor | |
| TAsynchronousArgument |
Remarks
This class provides a queued execution strategy. However, it does not provide a concrete implementation of the queue itself, since there are several ways to skin that particular cat.
Constructors
QueuedThreadBase()
Constructor, only called from derived classes.
Declaration
protected QueuedThreadBase()
Properties
WorkInformation
The derived class must provide an implementation of actual storage/allocation of units of work, in whatever manner supports the execution model.
Declaration
protected abstract QueuedThreadBase<TAsynchronousHandlerProcessor, TAsynchronousArgument>.WorkInfo WorkInformation { get; }
Property Value
| Type | Description |
|---|---|
| QueuedThreadBase.WorkInfo<> |
Methods
ScheduleNewWork()
Scheduling strategy method, provides the basic "queue and process in FIFO order" strategy
Declaration
protected override void ScheduleNewWork()
Overrides
Remarks
The queue actually used is an abstract property, that must be implemented by a derived class. This ducks the question of what kind of queue we're using, whether it is static by the calling thread, or whatever.
If no worker thread is currently running, one is created after the work has been queued.