public class Refill extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
long |
getPeriodNanos() |
long |
getTokens() |
static Refill |
smooth(long tokens,
Duration period)
Creates refill which regenerates the tokens in greedy manner.
|
String |
toString() |
public static Refill smooth(long tokens, Duration period)
The three refills above absolutely equals.Refill.smooth(600, Duration.ofMinutes(1));
Refill.smooth(10, Duration.ofSeconds(1));
Refill.smooth(1, Duration.ofMillis(100));
tokens
- period
- public long getPeriodNanos()
public long getTokens()
Copyright © 2018. All rights reserved.