Skip to content
Sharp

Reactive Streams · interview question

In the context of Project Reactor, what is the primary purpose of the 'publishOn' method?

Multiple choiceMediumchapter-19-curatedpremiumreactive-streamswebflux-vs-virtual-threads
Choose one answer
Answer and explanation

Correct answer

D. To switch execution to a different Scheduler.

Why

The 'publishOn' method in Project Reactor is used to switch the execution context to a different Scheduler, allowing you to control on which thread the subsequent operations will run.

Test yourself on Reactive Streams

A free test with instant, explained results. No account needed.

Start free test
All Reactive Streams questions →