-
Notifications
You must be signed in to change notification settings - Fork 136
Understanding the pull push model of simple react
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.
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.
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.
oops - my bad