Skip to content

v0.60 : anyOf and EagerFutureStream operations on underlying Futures

Compare
Choose a tag to compare
@johnmcclean johnmcclean released this 10 Mar 22:12
· 3361 commits to master since this release

New in SimpleReact v0.60

anyOf enhancement

anyOf progresses the flow with the first result received.

eagerfuturestream anyof

Example

 new SimpleReact().reactToCollection(urls)
                            .map(restAgent::call)
                            .anyOf(processor::transform)
                            .then(saver::save);

EagerFutureStream operations on underlying Futures

EagerFutureSteam operations typically operate on the result of an operation rather than the underlying Stream of CompletableFutures. For example limit works by accepting the first X results and rejecting all subsequent ones.

eagerfuturestream limit

limitFutures on the other hand operates on the underlying Futures in much the same way as LazyFutureStream limit does. (LazyFutureStream typically operates on the underlying Futures as they can be infinite in size). e.g.

lazyfuturestream - limit

[Behaviour for LazyFutureStream limit and EagerFutureStream limitFutures]

The new Future operations are

limitFutures

skipFutures

eagerfuturestream - skipfutures

zipFutures

eagerfuturestream zipfutures

zipFuturesWithIndex

eagerfuturestream zipfutureswithindex

duplicateFutures

eagerfuturestream duplicatefutures

splitAtFutures

eagerfuturestream splitatfutures

sliceFutures

eagerfuturestream slicefutures

compared with standard slice

eagerfuturestream slice

Bug fix for EagerFutureStream.slice

Adding SimpleReact as a Dependency

Gradle

compile group: 'com.aol.simplereact', name:'simple-react', version:'0.6'

Maven

 <dependency>
   <groupId>com.aol.simplereact</groupId>
     <artifactId>simple-react</artifactId>
      <version>0.60</version>
     <scope>compile</scope>
   </dependency>

Javadoc

http://www.javadoc.io/doc/com.aol.simplereact/simple-react/0.60