Class AsynchronousHandlerProcessor<TAsynchronousArgument>
Base class for processing carried out by AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument> and implementations of such.
Inheritance
Inherited Members
Namespace: SuperOffice.Threading
Assembly: SoCore.dll
Syntax
public abstract class AsynchronousHandlerProcessor<TAsynchronousArgument>
where TAsynchronousArgument : class
Type Parameters
Name | Description |
---|---|
TAsynchronousArgument | Type of object used as argument for processing asynchronous. |
Remarks
Thread handling and processing are separated into two parts. This part represents processing.
Implementations of this class needs to have a default constructor to work with AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument>.
This class is instantiated by the AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument>.
Constructors
AsynchronousHandlerProcessor()
Declaration
protected AsynchronousHandlerProcessor()
Properties
Argument
Argument for the processor to work with.
Declaration
protected TAsynchronousArgument Argument { get; }
Property Value
Type | Description |
---|---|
TAsynchronousArgument |
HasWorkToDo
Implemented by sub classes. Get if there are work to be carried out.
Declaration
public abstract bool HasWorkToDo { get; }
Property Value
Type | Description |
---|---|
Boolean |
ThreadName
Implemented by sub classes to get the name of the thread.
Declaration
public abstract string ThreadName { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Used by AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument> to get a meaning full name of the thread.
Methods
ExecuteWork()
Implemented by sub classes to execute the actual work.
Declaration
public abstract void ExecuteWork()
OnSetup(TAsynchronousArgument)
Called by AsynchronousHandler<TAsynchronousHandlerProcessor, TAsynchronousArgument> to initiate processing.
Declaration
public virtual bool OnSetup(TAsynchronousArgument argument)
Parameters
Type | Name | Description |
---|---|---|
TAsynchronousArgument | argument | Argument to use for processing. |
Returns
Type | Description |
---|---|
Boolean | True if able to sert up correctly. |
Remarks
The default implementation copies the argument to a member variable exposed by the Argument property