Skip to content

Conversation

@gehel
Copy link

@gehel gehel commented Jul 27, 2017

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.

Guillaume Lederrey added 2 commits July 27, 2017 14:15
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
convertion. It can be removed once all TimeUnit based methods have been
removed.
Copy link

@l0s l0s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change and so the major version number should be incremented.

I'm not the maintainer, btw. Just offering feedback :-)

*/
public FixedIntervalRefillStrategy(Ticker ticker, long numTokensPerPeriod, Duration period)
{
this.ticker = ticker;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be replaced by a JDK Clock?

<groupId>org.threeten</groupId>
<artifactId>threeten-extra</artifactId>
<version>1.2</version>
</dependency>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be achieved without adding a new dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants