-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Merge can now operate in horizontally unbounded mode. #3169
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
I'll have to allocate some time to review this later as it is somewhat detailed. Thank you for tackling this. |
That was done by design, since scalars behave as The reason we can't limit the number of async |
I forgot to add the choice because 2.x SpscArrayQueue doesn't use Unsafe. I copied the SpscAtomicArrayQueue from ReactiveX#3169 and I hope it won't conflict.
👍 |
I'll rebase this. |
fb80b82
to
e8beca7
Compare
Rebased, let's get this finally in. |
Merge can now operate in horizontally unbounded mode.
Thanks |
I forgot to add the choice because 2.x SpscArrayQueue doesn't use Unsafe. I copied the SpscAtomicArrayQueue from ReactiveX#3169 and I hope it won't conflict.
Resolves #3156
Note that since the default merge operation is unbounded, this change could lead to an excessive memory usage when flatMapping fast sources. Note that the pre 1.0.13 version did this albeit on a slighty slower path.
The change also affects the scalar optimization as well. Pre 1.0.13 implicitly limited the concurrency level to RxRingBuffer.SIZE when scalars were received. This version now fills the queue up to the concurrency level.
For 2.0, I suggest having a bounded behavior by default and require the developer to specify Integer.MAX_VALUE to go for the unbounded behavior so he/she knows about the consequences.