Skip to content

Separating Task Executors

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

Separating Task Executors

Each stage in a simple-react flow can be executed by a different task executor, this is one option for giving different amounts of resources to each stage in a flow.

  new SimpleReact(fastStageTaskExecutor)
                .react( () -> 1, () ->2)
                .then( input -> input*100)
                .withTaskExecutor(slowStageTaskExecutor)
                .then(input -> writeToDb(input))
                .withTaskExecutor(fastStageTaskExecutor)
                .then(input -> respond(input))
Clone this wiki locally