简体   繁体   中英

What's the benefit of using reactive programming over ExecutorService?

If both are asynchronous in nature, then what's the use of using Reactive programming over ExecutorService in Java? In what ways reactive programming can be found effective as compared to ExecutorService?

Asynchronous programming usually includes some kinds of task interaction. Different kinds of asynchronous programming provide different kinds of task interaction.

ExecutorService executes submitted tasks as soon as there exists available processor, that is, it provides only simplest form of asynchronous programming, without task interaction at all.

Reactive programming provides channels to exchange messages with backpressure, which is quite advanced kind of task interaction. But under the hood, it still uses an ExecutorService.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM