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

Change behaviour of BackPressuredBufferedSubscribers #350

Closed
alexandru opened this issue Apr 26, 2017 · 0 comments
Closed

Change behaviour of BackPressuredBufferedSubscribers #350

alexandru opened this issue Apr 26, 2017 · 0 comments
Assignees

Comments

@alexandru
Copy link
Member

alexandru commented Apr 26, 2017

The current implementation (~ version 2.2.4) of BackPressuredBufferedSubscriber is a little unfair due to using 2 queues - the second queue becomes active when the back-pressured state is activated.

However pulling from 2 queues alternatively is bound to create either efficiency or fairness issues and in our case it creates fairness issues. This isn't a problem with the current implementation in general, but there are cases where it can create problems due to the secondQueue being queried after the firstQueue.

Changing the implementation to use a single queue, since the BackPressuredBufferedSubscriber is effectively unlimited, the back-pressuring being only a hint for the producer to stop. By doing this we have a better chance at preserving ordering and fairness, which is also important for the "batched subscriber" which shares the same implementation.

EDIT: this also fixes #343.

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

1 participant