public class Refill extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
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
- Copyright © 2017. All rights reserved.