[infinispan-dev] Reactive Streams + RxJava

Galder Zamarreño galder at redhat.com
Tue Jun 20 03:57:17 EDT 2017


--
Galder Zamarreño
Infinispan, Red Hat

> On 15 Jun 2017, at 23:20, William Burns <mudokonman at gmail.com> wrote:
> 
> I was thinking more about [1] and I find that I was going to implement basically reactive streams. What we have now in github is similar but it uses a very crude method of blocking the thread to prevent back pressure. This can then cause severe issues as many users have found out when they don't close iterator.
> 
> Unfortunately reactive streams is just a spec.

Not just as spec. Java 9 will come with a set of interfaces that allows you to implement reactive streams:
http://download.java.net/java/jdk9/docs/api/java/util/concurrent/Flow.html

> I am proposing to add RxJava [2] as a dependency [2] in the core module to provide access to reactive streams and the various conversion methods. This library adds a bunch of support for built in back pressure, transformations and much more which would reduce the amount of code I would need to write substantially.

I don't think I like the idea of tying our core module to RxJava. Back when I was doing the functional map API we did consider using something like RxJava for the async multi-value streams, but decided against it to avoid tying ourselves to that.

A better alternative, if the APIs fit your use case, would be to depend on Java 9 APIs (oswego might have Java 8 version of those interfaces) and use maybe RxJava as the implementation of that API, if there's a suitable implementation for it.

If there's no choice but to use RxJava for the API part, I'd rather that happens in separate module to core.

Cheers,

> 
> In regards to timing, I am thinking this is too close for 9.1, so maybe 9.2 or higher.
> 
> What do you guys think?
> 
> [1] https://issues.jboss.org/browse/ISPN-7865
> [2] https://github.com/ReactiveX/RxJava
> [3] https://mvnrepository.com/artifact/io.reactivex.rxjava2/rxjava/2.1.0
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev




More information about the infinispan-dev mailing list