Try Playground
Show / Hide Table of Contents

Method GetTaskResult

GetTaskResult(String)

Get a trackable instance of the Task with specified taskId.

Declaration
[Obsolete("This API is deprecated and will be removed in a future release. This feature is being retired and will not be continued in future versions.", false)]
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
ICache cache = CacheManager.GetCache("demoClusteredCache");

string key1 = "2202";

Product product1 = new Product()
{
    Id = 4,
    Category = "Clothes",
    UnitPrice = 4,
    UnitsAvailable = 2
};

string key2 = "2203";
Product product2 = new Product()
{
    Id = 4,
    Category = "Shoes",
    UnitPrice = 5,
    UnitsAvailable = 9
};

cache.Add(key1, product1);
cache.Add(key2, product2);

MapReduceTask mapReduceTask = new MapReduceTask();
mapReduceTask.Mapper = new ProductCountMapper();
mapReduceTask.Combiner = new ProductCountCombinerFactory();
mapReduceTask.Reducer = new ProductCountReducerFactory();

string query = "SELECT Alachisoft.NCache.Sample.Data.Product WHERE this.Category IN (?)";
QueryCommand queryCommand = new QueryCommand(query);
queryCommand.Parameters.Add("Category", "Clothes");

ITrackableTask trackableInstance = cache.ExecutionService.ExecuteTask(mapReduceTask, null, queryCommand);

string taskID1 = trackableInstance.TaskId;
Random randomNumber = new Random();
string taskID2 = randomNumber.Next(2).ToString();

ITrackableTask testResult = cache.ExecutionService.GetTaskResult(taskID1); //returns the traceable instance

testResult = cache.ExecutionService.GetTaskResult(taskID2); //returns nothing as no task with such id is being running
In This Article
  • GetTaskResult(String)

Contact Us

PHONE

+1 (214) 764-6933   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • NCache Enterprise
  • NCache Professional
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
� Copyright Alachisoft 2002 - 2025. All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top