• Webinars
  • Docs
  • Download
  • Blogs
  • Contact Us
Try Free
Show / Hide Table of Contents

Method GetCounter

GetCounter(String, ReadThruOptions)

Returns instance of the counter specified with backing source Read Thru option.

Declaration
ICounter GetCounter(string key, ReadThruOptions options = null)
Parameters
Type Name Description
System.String key

Name of counter

ReadThruOptions options

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

Returns
Type Description
ICounter

Interface for using counters

Examples

This example demonstrates how to get a distributed counter handler from ICache.

 ICache cache = CacheManager.GetCache("demoCache");
string dataTypeName = "DistributedCounter";

ICounter counter = cache.DataTypeManager.GetCounter(dataTypeName);
Back to top Copyright © 2017 Alachisoft