question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for fixed interval refill

See original GitHub issue

In opposite to smooth refill which adds token as soon as possible, interval refill should regenerate tokens periodically.

Proposed API:

public static Refill fixedInterval(long tokens, Duration period) {
    // ...
}

public static Refill fixedInterval(Instant timeOfFirstRefill, long tokens, Duration period) {
     // ...
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16

github_iconTop GitHub Comments

2reactions
vladimir-bukhtoyarovcommented, Apr 13, 2018

The proposed API to specifying interval refill:

// 1000 tokens per minute, refill happens with one second interval
Bandwidth limit = Bandwidth.simple(1000, Duration.ofMinutes(1))
                                .withFixedRefillInterval(Duration.ofSecond(1));

Bucket bucket = Bucket4j.builder()
    .addBandwith(limit)
    .build();

I am not sure that withFixedRefillInterval is best name for method(resilience4j uses limitRefreshPeriod), feel free to propose more suitable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Synchronized Prescription Refill Program Improved ...
Synchronizing refills might be a promising intervention to improve adherence to maintenance medications, especially among Medicare patients with low baseline ...
Read more >
Prescription Refills, Part-Fills and Intervals - OCPInfo.com
Intervals are only required for refills of controlled drugs, but may be specified by the prescriber on any prescription, especially where drug monitoring...
Read more >
SCRIPT Implementation Recommendations Document - NCPDP
ePrescribing Best Practices When the Patient requests the Pharmacist Send Refill Requests to a. Different Prescriber or the Pharmacy is ...
Read more >
FREQUENTLY ASKED QUESTIONS
Partial refills of schedules III and IV controlled substance prescriptions are permissible under federal regulations provided that each partial filling is ...
Read more >
Prescription of Controlled Substances: Benefits and Risks
Schedule III drugs are prescribable verbally over the phone, with a paper prescription, or via EPCS. Within a six-month time frame, refill ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found