-
Notifications
You must be signed in to change notification settings - Fork 357
Feature/rate limiter publisher #672
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
Conversation
Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
0c3bfe2 to
7b822a9
Compare
replacement for coordinated request publisher Signed-off-by: Oleh Dokuka <shadowgun@i.ua>
7b822a9 to
3b25e68
Compare
|
I thought this was already directly possible based on optional Spring Reactor operations? I hate the infinite then cancel default mode of Reactor, but why the need to implement yourself? |
|
@yschimke I consider that as a replacement for LimitableRequestPublisher which does |
|
Thanks for the explanation. Is this worth opening an issue with reactor as well? |
|
I think, I'm going to port it eventually, but it worth, indeed |
| public void request(long n) { | ||
| synchronized (this) { | ||
| long requested = externalRequested; | ||
| if (requested == Long.MAX_VALUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't appear to match the logic on line 56. Integer vs Long MAX_VALUE. It's hard to intuit whether that's intentional because there are multiple fields. Maybe some comments to clarify what max values are used.
robertroeser
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM - I'd like to merge this in to start testing if its ready to go.
This reverts commit 88ee909
In this PR I want to introduce rate-limited request coordinator which basically prevents direct Long.MAX_VALUE propagation.
I'm considering moving this part to "addons" and instrument RSocket via
pluginAPI.For now, leave it in this for pre-reviewing