ITask

Assembly: System;

Namespace: Prognoz.Platform.Interop.ForeSystem;

Description

The ITask interface contains basic methods and properties that are used to work with tasks.

Inheritance Hierarchy

ITask

Comments

A task is a unit of executable code started in synchronous or asynchronous mode with respect to the current application.

The current implementation supports the following types of special tasks:

To work with a task, the user needs to create an object that is an instance of a special task, set up object parameters and cast it to the ITask interface.

A special task can be created using the following methods:

If required, execution of several tasks can be scheduled. To create a queue, use the ContinueWith method. A queue may include special tasks or the tasks that execute an action implemented in application code.

If all conditions for special tasks are satisfied, the task operates in asynchronous mode. Asynchronous mode does not support addressing form controls and the form itself. If visual part is to be used, synchronous operation mode is to be run.

NOTE. Synchronous execution is supported only in the desktop version of Foresight  Analytics Platform.

Properties

  Property name Brief description
Action The Action property returns parameters of the action executed under the current task.
Exception The Exception property returns information on the error occurred at the task runtime.
IsCompleted The IsCompleted property returns whether the task is completed.
Result The Result property returns task execution result.
State The State property returns the current state for the task.

Methods

  Method name Brief description
Cancel The Cancel method cancels task execution.
ContinueWith The ContinueWith method creates an action execution task, which starts depending on the result of the current task, and adds it to task queue.
Start The Start method starts task execution.
Wait The Wait method pauses the current application until the task is completed.

See also:

System Assembly Interfaces