Class ThreadPerOperationBase<TAsynchronousHandlerProcessor, TAsynchronousArgument>
This class provides a thread-per-operation execution model, where (in principle) a new thread is spawned and immediately starts executing for each asynchronous operation. The number of threads is limited by configuration information, and callers will block once the limit is reached.
Inheritance
AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument>
ThreadPerOperationBase<TAsynchronousHandlerProcessor, TAsynchronousArgument>
Inherited Members
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public abstract class ThreadPerOperationBase<TAsynchronousHandlerProcessor, TAsynchronousArgument> : AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument> where TAsynchronousHandlerProcessor : AsynchronousHandlerProcessor<TAsynchronousArgument>, new()
where TAsynchronousArgument : class
Type Parameters
Name | Description |
---|---|
TAsynchronousHandlerProcessor | |
TAsynchronousArgument |
Constructors
ThreadPerOperationBase()
Constructor, only called from derived classes
Declaration
protected ThreadPerOperationBase()
Methods
ScheduleNewWork()
Scheduling strategy method, provides the basic "queue and process in FIFO order" strategy
Declaration
protected override void ScheduleNewWork()
Overrides
SuperOffice.Threading.AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument>.ScheduleNewWork()
Remarks
Thread number limiting is a global responsibility, handled by the ThreadManager class. It will block if no thread slots are available.
Extension Methods
EnumUtil.MapEnums<From, To>(From)