token-bucket
token-bucket copied to clipboard
Use the newer java.time.Duration to represent duration
Up to now the code used (or abused) java.util.concurrent.TimeUnit. Duration is a better representation, which encapsulate the amount and the unit in a single class.
Method using TimeUnit have been deprecated and delegate to the new methods using Duration. A dependency to threeten-extra has been added to do this conversion. It can be removed once all TimeUnit based methods have been removed.
Pushed minimum compiler version to 1.8 to allow the use of Duration.