Parallel processing

Reactor publishers and subscribers do not create threads. However, as seen in the previous section, there are operators that can alter this behavior. In the last section, we saw that the delay operator moved the execution of the Reactor chain from the main thread to the scheduler thread. However, we do not need delay/timeout operators for the purpose of switching execution. Reactor offers the publishOn and subscribeOn operators for the purpose of switching the chain execution. Both of these operators change the execution context of the reactive chain to the configured scheduler.

Get Hands-On Reactive Programming with Reactor now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.