Counters
The Server API provides a set of functions for managing counters.
Functions:
counterCreate- creates a fast thread unsafe counter.counterCreateAtomic- creates a thread safe counter.counterOpen- obtains an id for an existing counter.counterGetNames- retrieves a list of all available counters.counterGet- retrieves the current value of a counter.counterSet- assigns a new value to a counter.counterAdd- increments the counter by the specified value.counterIncrement- increments the value of a counter by one.counterDecrement- decremenets the value of a counter by one.counterSubscribe- subscribes for a counter to monitor changes.counterUnsubscribe- unsubscribes from a counter to stop monitor changes.
Events:
on_counter_changeevent is called when a counter value gets changed.
SEE ALSO
Read more about “counters” for the server configuration file.