Add non-leaky bucket implementation
devmattrick opened this issue · 2 comments
devmattrick commented
Hello, I think it may be a good idea to include a non-leaky bucket implementation. Instead of it eventually doing the intended action, just block the action altogether.
jhurliman commented
@mattrick16 that sounds like a great idea. I won't have time to do the implementation by myself in the near future, but if anyone does start working on it please let me know in this ticket.
jhurliman commented
Actually, this should already be possible with tryRemoveTokens
. It's a synchronous method that will return false if the requested number of tokens could not be removed.