-
Notifications
You must be signed in to change notification settings - Fork 134
Automatic Optimization [autoOptimize]
johnmcclean-aol edited this page Sep 9, 2015
·
2 revisions
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

oops - my bad