Method GetTaskResult
GetTaskResult(String)
Get a Trackable instance of the task with specified taskId.
Declaration
public virtual ITrackableTask GetTaskResult(string taskId)
Parameters
Type | Name | Description |
---|---|---|
System.String | taskId | Task Id of the Map reduce task |
Returns
Type | Description |
---|---|
ITrackableTask | Returns an instance to track the task for result and status. |
Examples
Cache _cache = NCache.InitializeCache("myCache");
product1 = new Product(3, "Tunnbr?d", "", 4, 2);
product2 = new Product(4, "Tunnbr?d", "", 5, 9);
_cache.Add("2202", product1);
_cache.Add("2203", product2);
// Implement Map Reduce Interferaces
MapReduceTask mapReduceTask = new MapReduceTask();
ITrackableTask trackableTask = _cache.ExecuteTask(mapReduceTask);
string taskID1=trackableTask.TaskId;
Random randomNumber = new Random();
string taskId2 = randomNumber.Next(2).ToString();
ITrackableTask testResult = _cache.GetTaskResult(taskId1); //returns the traceable instance
testResult = _cache.GetTaskResult(taskId12); //returns nothing as no task with such id is being running