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

Blocking behaviour #3

Open
jarodriguez-itsoft opened this issue Jan 9, 2020 · 1 comment
Open

Blocking behaviour #3

jarodriguez-itsoft opened this issue Jan 9, 2020 · 1 comment
Labels
enhancement New feature or request stalled

Comments

@jarodriguez-itsoft
Copy link

First of all, congrats on the library, finally a library which address fairness ;)

I have reviewed the documentation and I miss a very helpful -and needed in my specific case- feature: being able to perform a blocking ask.

If I'm not wrong, if there is no quota left, the ask function inmediately returns an error with the root cause.
Instead of returning and error, I propose an additional option to the ask function to block until there is another available slot for the requester.
In another rate limiting libraries, an additional setting allows to set a limit on how many simultaneous blocked requests can be waiting, and default to deny requests if that limit is reached and a new request is made.

At the end this behaviour is equivalent to allow reserving slots in advance.

@g-andrade
Copy link
Owner

First of all, congrats on the library, finally a library which address fairness ;)

Thank you!

I propose an additional option to the ask function to block until there is another available slot for the requester.

It's an interesting feature, and it had occurred to me in the past. Perhaps sbroker could be used to broker requests between the category process and the consumers.

I'll leave this issue open as a reminder.

@g-andrade g-andrade added enhancement New feature or request stalled labels Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stalled
Projects
None yet
Development

No branches or pull requests

2 participants