Try Playground
Show / Hide Table of Contents

Method Invoke

Invoke(IEnumerable<String>, IEntryProcessor, ReadThruOptions, WriteThruOptions, Object[])

Execution of entry processor on a set of keys (regardless of caching topology used), allows to execute code against a set of cache entries on server-side, without fetching any data on client-side.

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)]
ICollection Invoke(IEnumerable<string> keys, IEntryProcessor entryProcessor, ReadThruOptions readThruOption = null, WriteThruOptions writeThruOption = null, params object[] arguments)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<System.String> keys

Set of keys of Cache entries on which EntryProcessor will be executed.

Alachisoft.NCache.Runtime.Processor.IEntryProcessor entryProcessor

IEntryProcessor instance.

ReadThruOptions readThruOption

ReadThruOptions to read from data source. These can be either ReadThru, ReadThruForced or none.

WriteThruOptions writeThruOption

WriteThruOptions regarding updating the data source. This can be either WriteThru, WriteBehind or none.

System.Object[] arguments

Arguments list for the process.

Returns
Type Description
System.Collections.ICollection

Returns a collection of instances of IEntryProcessorResult.

Examples
ICache cache = CacheManager.GetCache("demoClusteredCache");

//Get a new instance of sample Class implementing EntryProcessor interface.
CustomEntryProcessor myProcessor = new CustomEntryProcessor();
string[] keys = new string[] { "1", "5", "12", "15" };

cache.Insert(keys[0], "Value1");
cache.Insert(keys[1], "Value1");
cache.Insert(keys[2], "Value1");
cache.Insert(keys[3], "Value1");
//Invoking the Entry processor against a set of items.

ReadThruOptions readThruOptions = new ReadThruOptions(ReadMode.ReadThru, "ProdDataSource");
WriteThruOptions writeThruOptions = new WriteThruOptions(WriteMode.WriteThru, "ProdDataSource");

ICollection retEntries = cache.ExecutionService.Invoke(keys, myProcessor,readThruOptions,writeThruOptions);

Invoke(String, IEntryProcessor, ReadThruOptions, WriteThruOptions, Object[])

Execution of entry processor (regardless of caching topology used), allows to execute code against a cache entry on server-side, without fetching any data on client-side.

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)]
object Invoke(string key, IEntryProcessor entryProcessor, ReadThruOptions readThruOption = null, WriteThruOptions writeThruOption = null, params object[] arguments)
Parameters
Type Name Description
System.String key

Key of Cache entry on which the EntryProcessor is executed.

Alachisoft.NCache.Runtime.Processor.IEntryProcessor entryProcessor

IEntryProcessor instance

ReadThruOptions readThruOption

ReadThruOptions to read from data source. These can be either ReadThru, ReadThruForced or none.

WriteThruOptions writeThruOption

WriteThruOptions regarding updating the data source. This can be either WriteThru, WriteBehind or none.

System.Object[] arguments

Arguments list for the process.

Returns
Type Description
System.Object

Returns an instance of IEntryProcessorResult.

Examples
ICache cache = CacheManager.GetCache("demoClusteredCache");

//Get a new instance of sample Class implementing EntryProcessor interface.
CustomEntryProcessor myProcessor = new CustomEntryProcessor();
string[] keys = new string[] { "1", "5", "12", "15" };

cache.Insert(keys[0], "Value1");
cache.Insert(keys[1], "Value1");
cache.Insert(keys[2], "Value1");
cache.Insert(keys[3], "Value1");
//Invoking the Entry processor against a set of items.

ReadThruOptions readThruOptions = new ReadThruOptions(ReadMode.ReadThru, "ProdDataSource");
WriteThruOptions writeThruOptions = new WriteThruOptions(WriteMode.WriteThru, "ProdDataSource");
Object invokerVal = cache.ExecutionService.Invoke(keys[2], myProcessor,readThruOptions,writeThruOptions);
In This Article
  • Invoke(IEnumerable<String>, IEntryProcessor, ReadThruOptions, WriteThruOptions, Object[])
  • Invoke(String, IEntryProcessor, ReadThruOptions, WriteThruOptions, Object[])

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