Simple Reactive Extension Style Support in Streams (original) (raw)

David Hartveld david at hartveld.com
Wed Apr 17 10:11:15 PDT 2013


There are several initiatives to 'port' some form of reactive extensions to Java. Netflix's is probably the most promising. It's open source, available at: https://github.com/Netflix/RxJava. Still under heavy development and feature-incomplete, but also used in production at Netflix (see their techblog, they posted a few blogs in January and February).

As for the possibility of basing a reactive stream library on the Stream API: The Stream API can be compared with LINQ to objects, or IEnumerable and its extension methods. These compare quite well in terms of general use

I have been experimenting with an Observable extends Stream in combination with Swing. Take a look at these two projects:

Finally, I have started to prototype a universal Queryable interface, which would provide the basic operators (methods) that would apply to both an Iterable and an Observer here:

https://github.com/dlhartveld/queryable/blob/master/src/main/java/com/hartveld/queryable/Queryable.java

But if your question is whether JDK 8 will provide anything like Rx, I can predict with confidence that it will not, because it is out of scope for the Stream API (remember, it is just Iterable/Enumerable) and, more importantly, it would delay the release of JDK 8 significantly. Something for the future, perhaps...

Regards, David

On Wed, Apr 17, 2013 at 4:47 AM, Olexandr Demura < oleksander.demura at gmail.com> wrote:

For me, mere java user ignorant of outside world, it looks like streams already designed to be used pretty much similarly to Rx style (w/o publish to observers and exceptions handling)

simple name substitution: Select -> map ManySelect -> flatMap Where -> filter Aggregate -> reduce Run -> forEach ForkJoin -> parallelStream Since streams are read-once, they should not use notifications and events, but reactive style libraries should consider implementing (Base-)Stream to be generally accepted in java 8 world, just like http://code.google.com/p/reactive4java/ project states it will. Did I miss something? 2013/4/16 Suminda Dharmasena <sirinath at sakrio.com> > Hi, > > Is it possible to follow through with infinite streams and add helper > classes for (.net) reactive extensions style usage. >



More information about the lambda-dev mailing list