-
Notifications
You must be signed in to change notification settings - Fork 198
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
samples of back pressure which can easily happen #726
base: master
Are you sure you want to change the base?
Conversation
just for example. no need to merge if you don't want to implement back pressure handling.
Nice example @musketyr . I tried using RxJava's support for reactive pull backpressure:
I think that the "reactive pull backpressure" pattern is meant to be used to prevent the backpressure problems you were describing. It would be nice to make sure that it's fully supported in RxGorm. |
Yeah, I can see you have the same problem as me when I run it. The problem with the I've tried the batch operator doing the same reactive pull approach as you've did but it doesn't work very well either as actually the batches were read one after another in high rate so I get into back pressure problem again. I know the solution lies somewhere here or here https://github.com/ReactiveX/RxJava/blob/1.x/src/main/java/rx/observables/AsyncOnSubscribe.java but it's way beyond my Rx knowledge. |
We support this in cases that we have control over, in the case of the MongoDB implementation support would have to be written in the mongodb-rx drivers. |
@musketyr @graemerocher It looks like the mongodb-rx drivers support the "reactive pull" backpressure (flow control) since the producer implements the request method. I assume it's a matter of making sure (=writing tests and fixing problems) that "reactive pull" is supported for all operators in the full chain up to the mongodb rx driver. One way to test it would be to inject some wrapper/proxy in the test that intercepts the interaction with the mongodb rx driver to see if demand is signaled correctly via request method calls. I guess it's easy to break "reactive pull" backpressure since supporting reactive backpressure is optional in RxJava v1. |
|
just for example. no need to merge if you don't want to implement back pressure handling. the test can run very long time or break the build with OOME.
cc @graemerocher