<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 20, 2017 at 3:59 AM Galder Zamarreño &lt;<a href="mailto:galder@redhat.com">galder@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
--<br>
Galder Zamarreño<br>
Infinispan, Red Hat<br>
<br>
&gt; On 19 Jun 2017, at 15:25, William Burns &lt;<a href="mailto:mudokonman@gmail.com" target="_blank">mudokonman@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Jun 19, 2017 at 8:34 AM Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt; wrote:<br>
&gt; You’re thinking about a pure implementation play, correct? RxJava or the Reactive Stream constructs would not be exposed to the user as API. Am I correct?<br>
&gt;<br>
&gt; Yes, that is correct. This is only for internal usage. My thought is maybe when we finally move to Java 9, we may expose the Flow API at some point, but nothing any time soon.<br>
<br>
^ Ok, that wasn&#39;t clear in the original email.<br>
<br>
If it&#39;s only for internal usage and no RxJava APIs are exposed, then I&#39;m fine with it.<br></blockquote><div><br></div><div>Yeah I am definitely not trying to expose any new API. And if we expose anything related to reactive streams I would recommend the reactive streams specification<span class="inbox-inbox-Apple-converted-space"> </span>[1], which includes interfaces that the Java 9 Flow API is based off of.</div><div><br></div><div>But what I am proposing is the addition of RxJava for is to help with the internal handling of distributed iterator and possibly cache loader to reduce the number of threads.</div><div><br></div><div>Another side point is we could even use reactive streams for the remote iterator in the client (in fact it is a perfect fit there, much less complex). But I am not proposing that at this point as I don&#39;t really want to add a dependency in the client.</div><div><br></div><div>[1] <a href="https://github.com/reactive-streams/reactive-streams-jvm/tree/v1.0.0#specification">https://github.com/reactive-streams/reactive-streams-jvm/tree/v1.0.0#specification</a></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
&gt;<br>
&gt; Also for posterity, we had backchannel chats about it and you said you felt vert.x was not necessarily addressing your needs. Could you elaborate a bit here?<br>
&gt;<br>
&gt; The main difference is that RxJava [1] has a full suite of utility methods around reactive streams [2]. Vert.x has some APIs around reactive streams [3], but it is rather limited.<br>
&gt;<br>
&gt; RxJava is about publishing/consuming your own streams without tying to any threading model (everything can be done on main thread for example). And it provides methods of mapping streams to others and even returning blocking APIs back to the user. Some methods in particular I was looking at were merge, delay, blockingIterable, rebatch and some others.<br>
&gt;<br>
&gt; Vert.x is really beneficial with reactive programming built upon existing tools (HTTP, JDBC and others). It also has the event bus and others but this is built on the vert.x event loop, which we just don&#39;t need in Infinispan. We already have our own threading model and communication over JGroups.<br>
&gt;<br>
&gt; My usage is to handle multiple streams of data coming from different locations and merging them together and doing some additional transformations. I could do this with either of the API, however RxJava already did a lot of heavy lifting I would have to do otherwise.<br>
&gt;<br>
&gt; Also another side note is that it might be helpful for vert.x to change over to something more like the upcoming Flow API from Java 9 (maybe [4] which is pretty much identical currently). RxJava uses this as a base class for it&#39;s Publish/Subscribe.<br>
&gt;<br>
&gt; [1] <a href="https://github.com/ReactiveX/RxJava/tree/2.x/src/main/java/io/reactivex" rel="noreferrer" target="_blank">https://github.com/ReactiveX/RxJava/tree/2.x/src/main/java/io/reactivex</a><br>
&gt; [2] <a href="http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html#blockingIterable()" rel="noreferrer" target="_blank">http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Flowable.html#blockingIterable()</a><br>
&gt; [3] <a href="https://github.com/eclipse/vert.x/tree/master/src/main/java/io/vertx/core/streams" rel="noreferrer" target="_blank">https://github.com/eclipse/vert.x/tree/master/src/main/java/io/vertx/core/streams</a><br>
&gt; [4] <a href="https://mvnrepository.com/artifact/org.reactivestreams/reactive-streams/1.0.0" rel="noreferrer" target="_blank">https://mvnrepository.com/artifact/org.reactivestreams/reactive-streams/1.0.0</a><br>
&gt;<br>
&gt;<br>
&gt; Emmanuel<br>
&gt;<br>
&gt;&gt; On 15 Jun 2017, at 23:20, William Burns &lt;<a href="mailto:mudokonman@gmail.com" target="_blank">mudokonman@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; 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&#39;t close iterator.<br>
&gt;&gt;<br>
&gt;&gt; Unfortunately reactive streams is just a spec. 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.<br>
&gt;&gt;<br>
&gt;&gt; In regards to timing, I am thinking this is too close for 9.1, so maybe 9.2 or higher.<br>
&gt;&gt;<br>
&gt;&gt; What do you guys think?<br>
&gt;&gt;<br>
&gt;&gt; [1] <a href="https://issues.jboss.org/browse/ISPN-7865" rel="noreferrer" target="_blank">https://issues.jboss.org/browse/ISPN-7865</a><br>
&gt;&gt; [2] <a href="https://github.com/ReactiveX/RxJava" rel="noreferrer" target="_blank">https://github.com/ReactiveX/RxJava</a><br>
&gt;&gt; [3] <a href="https://mvnrepository.com/artifact/io.reactivex.rxjava2/rxjava/2.1.0" rel="noreferrer" target="_blank">https://mvnrepository.com/artifact/io.reactivex.rxjava2/rxjava/2.1.0</a><br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; infinispan-dev mailing list<br>
&gt;&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
&gt; _______________________________________________<br>
&gt; infinispan-dev mailing list<br>
&gt; <a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
<br>
<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a></blockquote></div></div>