Skip to main content

msys.gauge_cache.define

Last updated March 2020

Name

msys.gauge_cache.define — Create a cache that can be used to maintain a set of counters

Synopsis

msys.gauge_cache.define(name, maxelems, ttl, replicated);

name: string
maxelems: number
ttl: number
replicated: boolean, optional

Description

Creates a cache that can be used to maintain a set of counters based on a string key. The ttl parameter is the number of seconds that a given entry will be maintained after it was last modified, and maxelems is the maximum number of named entries that will be stored in the cache. If a new entry is added, the oldest entry in the cache will be dropped to make room for the new entry. If replicated is set to true, (the default is false), then increments and decrements will be broadcast across the cluster.

Enable this function with the statement require(' msys.gauge_cache ');.

See Also

Was this page helpful?