Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some docs required #9

Open
salaboy opened this issue Nov 14, 2017 · 4 comments
Open

some docs required #9

salaboy opened this issue Nov 14, 2017 · 4 comments

Comments

@salaboy
Copy link

salaboy commented Nov 14, 2017

This Lib looks exactly to what I was looking for, but the lack of documentation makes it difficult to get started.
A quick example on how to use the APIs to limit REST calls should be enough. Also Spring Boot integration will be quite handy.

@mokies
Copy link
Owner

mokies commented Nov 15, 2017

Pull requests welcome!

There are some simple examples found within the project such as https://github.com/mokies/ratelimitj/tree/master/ratelimitj-redis . What exactly did you find confusing?

@fsamir
Copy link

fsamir commented Dec 21, 2017

I second @salaboy. A servlet filter implementation sample would help heaps.

For example, if you aren't familiar with Reactive it isn't straightforward hot to implement a non-blocking API Rate Limiter, which I believe is a common use case for ratelimitj.
Thanks

@mokies
Copy link
Owner

mokies commented Apr 14, 2018

Hi @fsamire and @salaboy,

Apologies for the long delay in replying. I have put together a very simple Servlet example to assist you, see https://github.com/mokies/ratelimitj/blob/master/ratelimitj-examples/src/main/java/ServletRateLimitedExample.java

@xenomachina
Copy link

Something that would help a lot (IMHO) are javadocs for the interfaces. Look at Baton for example:

public interface Baton {
    void release();
    <T> Optional<T> get(Supplier<T> action);
    void doAction(Runnable action);
    boolean hasAcquired();
}

What is a Baton? What guarantees does it make (and not make)? What do any of these methods do? (The doAction is especially puzzling here. When does it invoke the Runnable? What does it do before/after that? Does it behave differently if the baton is acquired or not? What if the Runnable throws an exception?)

I can infer much of this by looking at the existing implementations, but it's annoying to have to do that every time I need a refresher on how Baton objects work, and if I need to create my own implementation, I'm pretty much just guessing at the contract I'm supposed to be following.

READMEs and tutorials are nice to get people started, but javadocs are necessary for day-to-day work. I just want to navigate to Baton in my IDE and see the docs there.

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

No branches or pull requests

4 participants