Creating a new configuration with additional available tokens #177
-
Hi there, I am using Bucket4J for my API rate limiting functionality. I have a use case where I need to replace a configuration but none of the existing Example: Original configuration contains 100 tokens and 70 was used. As a result 30 tokens remains In other words the formula is Most of methods that I need are private or protected in scope so I'm not sure if this is actually possible in a plausible way |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hello @AnhTuanPW As you have already noticed, there is no functionality that can directly cover your use-case. But it looks that it should be a cheap change, I can release a new version at weekend. But I need some help from you to make this change: please propose a good name for constant there https://github.com/vladimir-bukhtoyarov/bucket4j/blob/master/bucket4j-core/src/main/java/io/github/bucket4j/TokensInheritanceStrategy.java as well as Javadocs. |
Beta Was this translation helpful? Give feedback.
-
It was explicit decision to not provide to the end-users the ability to write free form java code, because eventually it is planned to provide Redis Support based on Lua stored procedures, and it is obvious that it is not possible to translate java code into Lua. |
Beta Was this translation helpful? Give feedback.
-
Has been released with version 6.3.0 |
Beta Was this translation helpful? Give feedback.
Has been released with version 6.3.0