-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
RxJava + Reactive Streams #2917
Comments
Missing right now that I'd like to add is information on how to use RxJava for implementation a library but shading the dependency and exposing only Reactive Streams publicly, as I know this is something needed/wanted by library authors. It's easy to do but we should show how to do it. |
Good job! I think this page really clarify the relationship between RxJava and ReactiveStreams. A few comments:
|
Thank you for the feedback.
Valid point about And yes, moving to
It will be interesting to see whether
It's not a recommendation to support "each possible implementation", but the popular one or two that customers are asking for. It is definitely not required, it is a recommendation to alleviate the "cons" of exposing only interfaces. Current examples are Couchbase which have natively adopted RxJava 1.x and MongoDB which are exposing variants for RxJava (http://mongodb.github.io/mongo-java-driver-rx/) and Reactive Streams (http://mongodb.github.io/mongo-java-driver-reactivestreams/). Of course using just Reactive Streams is sufficient and a developer can then convert it to whatever implementation they wish to by themselves, or create their own wrapper of the APIs.
Yes, but note that the Reactive Streams API is only standardizing the protocol, not the higher order functions, scheduling or composition. The protocol of subscribe, request, onNext, onComplete, onError is important, but it's just the foundation. Anybody using Reactive Streams will need operators to make it usable, and the ReactiveStreams/Flow standard APIs don't offer any of those. And honestly I don't imagine that level of detail can or should be standardized beyond possibly map/flatMap. How do you think I should adjust my recommendation to be more realistic? |
Looking great, @benjchristensen, thanks for writing this up! |
Since RS is very strict on backpressure, I'd mention our backpressure control mechanisms because many of our operators (the timed ones especially) don't support backpressure and observing them from i.e. Akka streams could be a problem. I think these operators can't get RS compliant ever so RxJava 2.0 as a whole library won't be RS compliant. |
It can be compliant in that an
The RxJavaReactiveStreams bridge would emit an error in this case for 1.x. Version 2.x would need to behave as explained above. A valid outcome is to invoke
We choose strategy 2 as our default. |
Good idea. How should we proceed?
|
For RxJava 1.x there isn't anything we need to do. The RxJavaReactiveStreams bridge handles things (or should if it doesn't and we missed something). For RxJava 2.x I was experimenting but got distracted recently on making it so the abstractions of Observable/Publisher handle this. Let's take this up in the 2.x discussion issues instead of here. |
Thanks @rkuhn for the review. |
Currently, the PublisherAdapter doesn't verify if the upstream tries to onNext without request and it still has the concurrency issue with the HashMap. Do you want to do a PR for these? Edit: I post a PR there anyway. |
I see you're already doing a PR for it, thank you. |
I have updated the wiki page based on feedback I've received and a re-read of it. Hopefully it further clarifies some things without defeating my goal of being brief. |
Publishing the page now. If any further improvements please comment here. |
The following is interesting but not completely clear:
The wiki page is about RS so "base interface" could be interpreted as the RS interfaces. Yet the mention of "Reactive Extensions" sounds more like an interface for Rx operations? This can be re-phrased a little perhaps to disambiguate. Also the next sentence ("RxJava 2 intends on being a high performing...") seems like it should be a new paragraph? |
I'd like to get clear communication of the relationship and recommendations of how Reactive Streams and RxJava relate and work together. I have started here: https://github.com/ReactiveX/RxJava/wiki/Reactive-Streams
I'd appreciate comments on what should be added, removed or changed.
The text was updated successfully, but these errors were encountered: