Class ClientTaskRunner
An implementation of the TaskRunnerBase that can execute a provided IServerTask locally on the client application
Inherited Members
Namespace: LemonEdge.Client.Core.Tasks
Assembly: LemonEdge.ClientCore.dll
Syntax
public class ClientTaskRunner : TaskRunnerBase, IDisposable, ITaskRunner, IProcessor
Constructors
ClientTaskRunner(IModelLayoutCommon, bool, IServerTask, IServerTaskData, IEntityUpdater, IReadOnlyCache, UserInfo, BusyProgressReporter, CancellationTokenSource)
Creates a new cliet task runner for executing a server task locally
Declaration
public ClientTaskRunner(IModelLayoutCommon host, bool taskIsVirtual, IServerTask task, IServerTaskData data, IEntityUpdater updater, IReadOnlyCache cache, UserInfo user, BusyProgressReporter reporter, CancellationTokenSource cancel)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The host this task will be executed within |
bool | taskIsVirtual | Indicates if this task has actually been saved in the system. If true the runner will update and save the status of the task, otherwise it won't commit any status changes. |
IServerTask | task | The task to be executed virtually |
IServerTaskData | data | |
IEntityUpdater | updater | The top level updater context that the task can use to execute its main thread |
IReadOnlyCache | cache | A local cache the task can use |
UserInfo | user | The user the task is currently running under (will be the currently logged in user as the task is running locally) |
BusyProgressReporter | reporter | A class for reporting the status updates for the task. When running locally this would be the ClientTaskProgressDisplayer |
CancellationTokenSource | cancel |
Properties
RunningOnServer
False - This task is running locally from the client
Declaration
protected override bool RunningOnServer { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
TaskIsVirtual
Indicates the task is a fake task not actually saved in the database, so it should not be updated
By default this is false, indicating the processor is executing real tasks and should update their status, results, etc when complete
When true this is used by the client to create virtual tasks to just immediately process certain tasks, but can not have their status/etc updated when complete as they do not existDeclaration
protected override bool TaskIsVirtual { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Methods
CreateTaskHandler()
Returns a handler for processing the task result. Gives priority to any IClientTaskResultHandler to ensure the handler can interact with the client UI if required. Otherwise any found ITaskResultHandler for this task is returned.
Declaration
protected override ITaskResultHandler CreateTaskHandler()
Returns
Type | Description |
---|---|
ITaskResultHandler | A handler for processing the task result |
Overrides
InternalCreateUpdater()
Creates a new updater context from the local client connection using Connector.Instance.Create
Declaration
protected override Task<IEntityUpdater> InternalCreateUpdater()
Returns
Type | Description |
---|---|
Task<IEntityUpdater> | A new updater context |
Overrides
RunInternal()
Updates the client UI that this task is running as well as processing it
Declaration
protected override Task RunInternal()
Returns
Type | Description |
---|---|
Task | A task indicating the completion of the task running internally |