- 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.
- 物聯網與北斗應用
- Web安全防護指南:基礎篇
- RCNP實驗指南:構建高級的路由互聯網絡(BARI)
- EDA技術與VHDL編程
- 智能網聯汽車V2X與智能網聯設施I2X
- Hands-On Chatbot Development with Alexa Skills and Amazon Lex
- 物聯網信息安全
- 2018網信發展報告
- 區塊鏈輕松上手:原理、源碼、搭建與應用
- Yii Application Development Cookbook(Second Edition)
- 中國互聯網發展報告2018
- 網絡環境中基于用戶視角的信息質量評價研究
- Selenium WebDriver 3 Practical Guide
- 網絡安全之道
- 現場綜合化網絡運營與維護:運營商數字化轉型技術與實踐