Skip to content

Understanding the pull push model of simple react

johnmcclean-aol edited this page Mar 31, 2015 · 1 revision

Mixed pull / push model

simple-react operates under a mixed pull /push model. simple-react uses a Stream to manage chains of CompletableFutures.

The Stream pulls the chain of CompletableFutures into existance. Data is pushed asynchronously through the chain of CompletableFutures when it is ready.

screen shot 2015-03-30 at 11 00 14 am

The LazyFutureStream forEach operator will pull chains into existence one at a time. For EagerFutureStream and SimpleReactStreams, all chains are created immediately and data starts to push through immediately.

The run operator for LazyFutureStream allows greater managed parallelism, with a controlled number of chains being created at one time.

screen shot 2015-03-30 at 11 06 56 am

Building push based systems

It is also possible to build push based systems in simple-react. By making use to simple-react asynchronous datastructures as an entry point for external input. See PushableStreamBuilder and Pushing data into Java 8 Streams for details on the mechanics of such.

screen shot 2015-03-30 at 11 10 22 am

Resources

Clone this wiki locally