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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.