call method
Execute callback if token is available, otherwise do nothing.
Implementation
bool call(VoidCallback callback, [int tokens = 1]) {
if (tryAcquire(tokens)) {
callback();
return true;
}
return false;
}
Execute callback if token is available, otherwise do nothing.
bool call(VoidCallback callback, [int tokens = 1]) {
if (tryAcquire(tokens)) {
callback();
return true;
}
return false;
}