Skip to content

Automatic Optimization [autoOptimize]

johnmcclean-aol edited this page Sep 9, 2015 · 2 revisions

Automatic Optimization

The autoOptimize facility introduced in simple-react v0.99.1 helps to efficiently distribute your tasks over multiple threads. simple-react LazyFutureStreams are especially well suited for handling tasks related to blocking I/O, and autoOptmize makes it especially easy to, for example, make multiple rest calls (or load multiple files) and efficiently process the results.

new LazyReact().autoOptimizeOn()
                .range(0, 1_000_000)
                .map(this::loadByID)
                .map(this::process)
                .flatMap(Collection::stream)
                .filter(this::inScope)
                .forEach(this::save);

fan out across threads with autoOptimize screen shot 2015-09-01 at 4 23 45 pm

Clone this wiki locally