- 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.
- 網(wǎng)絡(luò)協(xié)議工程
- Building E-commerce Sites with VirtueMart Cookbook
- 農(nóng)產(chǎn)品物聯(lián)網(wǎng)研究與應(yīng)用
- Learning Karaf Cellar
- 信息通信網(wǎng)絡(luò)建設(shè)安全管理概要2
- Windows Server 2003 Active Directory Design and Implementation: Creating, Migrating, and Merging Networks
- 電力物聯(lián)網(wǎng)工程技術(shù)原理與應(yīng)用
- 物聯(lián)網(wǎng)之霧:基于霧計(jì)算的智能硬件快速反應(yīng)與安全控制
- IPv6網(wǎng)絡(luò)切片:使能千行百業(yè)新體驗(yàn)
- 夢(mèng)工廠之材質(zhì)N次方:Maya材質(zhì)手冊(cè)
- TCP/IP基礎(chǔ)(第2版)
- 智能物聯(lián)網(wǎng):區(qū)塊鏈與霧計(jì)算融合應(yīng)用詳解
- 物聯(lián)網(wǎng)導(dǎo)論
- Telerik WPF Controls Tutorial
- 網(wǎng)絡(luò)設(shè)備配置與調(diào)試項(xiàng)目實(shí)訓(xùn)