Property TaskStatus
TaskStatus
Gets the task’s status and contains following values: Waiting, InProgress, Completed, Cancelled, Failed.
Declaration
TaskStatus TaskStatus { get; }
Property Value
Type | Description |
---|---|
TaskStatus |
Examples
Example checks for task status after an interval of 5 seconds
ITrackableTask taskTracker = cache.ExecuteTask(prodAggregatorTask, new OrderKeyFilter());
int count = 0;
do
{
Thread.Sleep(5000);
if (count == 2)
{
taskTracker.CancelTask();
break;
}
else count++;
} while (taskTracker.TaskStatus.Progress == Alachisoft.NCache.Runtime.MapReduce.TaskStatus.Status.InProgress);