-
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 2.0 #2450
Comments
We have a similar issue for the future of Reactor, and after spending months implementing a reasonable scope of Rx (but native Reactive Stream Publisher/Subscriber) I feel we can do better for the JVM community ! That essentially calls for some convergence and reduce the scope of Reactor and contribute things to ReactiveX, depends on it and continue there. The fact we follow the contract and the naming alignment is a first step IMO. As you know some operations will probably be exception to the spec. What do we have mainly in reactor-core and how it compares to Rx:
So the gap is in the implementation of a specific dispatcher, metrics for stream/bus, (async utils?), io operations, key/value operations and mainly the native work with RS/JDK8-like interface. We can certainly help transforming rxjava 2.0 into a standard RS impl and try to provide some sort of convergence for the stuff we get rid off. Ultimately that would be great if sticking to naming from rx (and we have experimented switching between RxJava and Reactor), the transition won't be painful for the users. However this will sometimes call for behavior change due to the spec but not too much, coming from rxjava 1.x at least. I think we both have a mission to educate and propagate the practice both in Rx and Reactive Stream and that's great as our respective users will converge naturally 👍 |
It would also be interesting to see how we could leverage Java 8's pluggable types. We could potentially validate at compile time things that we currently can't detect until run time. Things like back pressure support or that Subscribers are implemented correctly. |
The Reactive Stream types have been proposed for Java 9: http://cs.oswego.edu/pipermail/concurrency-interest/2015-January/013641.html These are part of what we'd want to target for RxJava 2.0 for Java 9. |
As with Rx.NET, getting the base interfaces into Java is a good start. But I'm not sure what services/operators Java 9 wants to provide. Since
|
Yes, I'm not suggesting Java 9 will negate the need or desire for RxJava and its many operators, but that we want to target Java 9 and support the types and interop it will allow.
It's the same type of interop that would be permitted with Reactive Streams, except now standardized in the JDK. Not a big deal when only within the RxJava world, but quite useful when that's not the reality. Examples include how there are bindings and interop between Vert.x, Ratpack, Jersey, Akka, Reactor, etc. |
I totally agree with @benjchristensen. for example in "our" case, we don't have much control of where people deploy the SDK. If they are in a spring world and they use Reactor, with Reactive Streams (or any other interop), the have a way to transfer the powerful concepts into "their" world without loosing semantics or have to switch to blocking operations. Also on the pragmatic side: the less code RxJava has to maintain and the oracle folks do instead, the better. This also means greater adoption in all places, and people are going to build stuff we don't even know about yet. |
My view of the Java 9 world is that RxJava stops needing to define the foundational interfaces and semantics as JDK 9 will now include them, and it becomes more focused on being extensions to Java 9, as per its "Reactive Extensions" name, and providing a library of operators that can be composed and used when building reactive applications. |
Now we can use |
Capturing some further thoughts on this ... a major area of focus for RxJava 2.0 is to improve performance in areas where we have learned that the design impedes us. Unsubscribe ConcurrencyOne such area is how concurrent unsubscribes require the use of flatMap/mergeAnother area is I do think though that the default should be as now where no scheduling occurs and the producer threads always are the ones that emit. fusionThe Today it composes functions. We could change it internally to capture a list of functions that allows analysis and optimization via function fusion if we demonstrate a benefit. This could in fact probably be evaluated in 1.x as well since it shouldn't affect the public API. But I definitely want to revisit the need in RxJava 2.0, particularly since Java 9 as a target may have different performance characteristics. |
I can't be sure about all implications until I start coding against j.u.c.Flow/reactive-streams specs. A 2.0 branch with JDK 8 target would be nice soon. I have the uncanny feeling implementing the entire library purely on reactive-streams interfaces make things difficult. |
The list of issues for 2.0 are marked with the 2.0 milestone: https://github.com/ReactiveX/RxJava/milestones/2.0 Some important ones as we design include:
|
Looking towards the future this issue is for discussing what RxJava 2.0 might look like.
Current thinking (as of early 2015) is to target Java 9 and leverage JDK/JVM functionality added in Java 8/9 such as lambdas, value types (hopefully in Java 9),
Stream
andCompletableFuture
.It would also make sense to align more closely with Reactive Streams (https://github.com/reactive-streams/reactive-streams) since RxJava was involved in defining it. This would eliminate the need for a bridge (https://github.com/ReactiveX/RxJavaReactiveStreams).
RxJava 2.0 must be namespaced separately from 1.0 since RxJava 1.0 is committed to never breaking. This is essential in order for RxJava to be usable similar to
java.util
collections.The proposed namespacing is:
Issues for 2.0: https://github.com/ReactiveX/RxJava/milestones/2.0
The text was updated successfully, but these errors were encountered: