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 feature is not in active development and may be removed in a future update.")]
ICollection Invoke(IEnumerable<string> keys, IEntryProcessor entryProcessor, ReadThruOptions readThruOption = null, WriteThruOptions writeThruOption = null, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System. |
keys | Set of keys of Cache entries on which EntryProcessor will be executed. |
Alachisoft. |
entryProcessor | IEntryProcessor instance. |
Read |
readThruOption | Read |
Write |
writeThruOption | Write |
System. |
arguments | Arguments list for the process. |
Returns
Type | Description |
---|---|
System. |
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 feature is not in active development and may be removed in a future update.")]
object Invoke(string key, IEntryProcessor entryProcessor, ReadThruOptions readThruOption = null, WriteThruOptions writeThruOption = null, params object[] arguments)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | Key of Cache entry on which the EntryProcessor is executed. |
Alachisoft. |
entryProcessor | IEntryProcessor instance |
Read |
readThruOption | Read |
Write |
writeThruOption | Write |
System. |
arguments | Arguments list for the process. |
Returns
Type | Description |
---|---|
System. |
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);