Method CancelTask
CancelTask()
Cancels the already running task.
Declaration
void CancelTask()
Examples
Example cancels task if it is not completed in 15 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);