cur/1 | Return the current counter value. |
enter/2 | Attempt to increment the named counter, respecting the given limit. |
enter/3 | |
leave/1 | Attempt to decrement the named counter, with a lower limit of 0. |
leave/2 | |
state/0 | For debug purposes. |
cur(Name::term()) -> non_neg_integer()
Return the current counter value. It will return 0 if it does not exist.
enter(Name::term(), Limit::non_neg_integer()) -> false | {true, non_neg_integer()}
Attempt to increment the named counter, respecting the given limit. If the counter was successfully incremented, return {true, NewValue}. Otherwise, return false.
enter(Name::term(), Size::non_neg_integer(), Limit::non_neg_integer()) -> false | {true, non_neg_integer()}
leave(Name::term()) -> non_neg_integer()
Attempt to decrement the named counter, with a lower limit of 0. Return the new value. The counter must already exist.
leave(Name::term(), Size::non_neg_integer()) -> non_neg_integer()
state() -> any()
For debug purposes. Returns the state of all counters.
Generated by EDoc