Interface ITaskProcessor
The main interface for any process that can run as a IServerTask on a remote server
Any implementation needs to be marked with the ServerTaskAttribute
The parameters for this process must inherit ServerTaskParameter and can optionally be marked with the ServerTaskParametersAttribute as well.Any result handler must implement ITaskResultHandler and be marked with the ServerTaskResultAttribute
Any implementation does not have to be accessible in UI code, as long as ServerTaskParameter is accessible to create the parameters to send a task to the server (It must be marked with ServerTaskParametersAttribute then, it is not optional). This code can reside in core server implementations only.Inherited Members
Namespace: LemonEdge.API.Tasks
Assembly: API.dll
Syntax
public interface ITaskProcessor : IProcessor, IDisposable
Methods
Init(ITaskRunner, ServerTaskParameter)
Initializes the task processor with the parameters for processing the task
Declaration
Task Init(ITaskRunner runner, ServerTaskParameter ProcessTaskParameter)
Parameters
Type | Name | Description |
---|---|---|
ITaskRunner | runner | The context within which the task is being processed |
ServerTaskParameter | ProcessTaskParameter | The parameter for running this task |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task indicating the completion of the operationn |
ProcessTask(CancellationToken)
A function that implements the process for this task using the parameters provided during Init(ITaskRunner, ServerTaskParameter)
Declaration
Task<object> ProcessTask(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancel | A cancellation token for cancelling any long running task |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | An optional object detailing the result which can be converted using ITaskResultHandler into a ServerTaskResult, or is a ServerTaskResult itself |