- Hands-On Reactive Programming in Spring 5
- Oleh Dokuka Igor Lozynskyi
- 184字
- 2021-07-23 16:36:24
Application configuration
As we do not use the Publish-Subject approach and Spring's @EventListener annotation, we do not depend on Async Support, so the application configuration becomes simpler:
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
As we can see, this time we do not need to enable Async Support using the @EnableAsync annotation, and we also do not need to configure Spring's Executor for event handling. Of course, if required, we may configure a RxJava Scheduler for fine-grained thread management when processing reactive streams, but such a configuration would not depend on Spring Framework.
In turn, we do not need to change the code for the UI part of the application; it should work the same way as before. Here, we have to highlight that with the RxJava-based implementation, the temperature sensor is not probed when nobody listens. Such behavior is a natural consequence of the fact that reactive programming has a notion of active subscription. The Publish-Subject-based implementations do not have such properties, and as such are more limited.
- 解析QUIC/HTTP3:未來互聯(lián)網(wǎng)的基石
- 物聯(lián)網(wǎng)短距離無線通信技術應用與開發(fā)
- 物聯(lián)網(wǎng)安全(原書第2版)
- 物聯(lián)網(wǎng)網(wǎng)絡安全及應用
- 網(wǎng)管員典藏書架:網(wǎng)絡管理與運維實戰(zhàn)寶典
- Hands-On Chatbots and Conversational UI Development
- 網(wǎng)管員必讀:網(wǎng)絡管理(第2版)
- SAE原理與網(wǎng)絡規(guī)劃
- 人人都該都懂的互聯(lián)網(wǎng)思維
- Guide to NoSQL with Azure Cosmos DB
- Cisco無線局域網(wǎng)配置基礎
- 網(wǎng)絡基本通信約束下的系統(tǒng)性能極限分析與設計
- 萬物互聯(lián):物聯(lián)網(wǎng)核心技術與安全
- 互聯(lián)網(wǎng)心理學:新心理與行為研究的興起
- 一板成功:高速電路研發(fā)與設計典型故障案例解析