- Learning RxJava
- Thomas Nield
- 258字
- 2021-07-02 22:22:56
Basic Operators
In the previous chapter, you learned a lot about the Observable and Observer. We also covered a small number of operators, particularly map() and filter(), to understand the role of operators as well. But there are hundreds of RxJava operators we can leverage to express business logic and behaviors. We will cover operators comprehensively throughout much of this book, so you know which ones to use and when. Being aware of the operators available and combining them is critical to being successful using ReactiveX. You should strive to use operators to express business logic so your code stays as reactive as possible.
It should be noted that operators themselves are Observers to the Observable they are called on. If you call map() on an Observable, the returned Observable will subscribe to it. It will then transform each emission and in turn be a producer for Observers downstream, including other operators and the terminal Observer itself.
You should strive to execute as much logic as possible using RxJava operators, and you should use an Observer to receive the end product emissions that are ready to be consumed. Try not to cheat or get creative by extracting values out of the Observable chain, or resort to blocking processes or imperative programming tactics. When you keep algorithms and processes reactive, you can easily leverage the benefits of reactive programming such as lower memory usage, flexible concurrency, and disposability.
In this chapter, we will cover the following topics:
- Suppressing operators
- Transforming operators
- Reducing operators
- Error-recovery operators
- Action operators
- HTML5+CSS3+JavaScript從入門到精通:上冊(cè)(微課精編版·第2版)
- Python快樂編程:人工智能深度學(xué)習(xí)基礎(chǔ)
- 微服務(wù)與事件驅(qū)動(dòng)架構(gòu)
- Designing Hyper-V Solutions
- Blockly創(chuàng)意趣味編程
- 編譯系統(tǒng)透視:圖解編譯原理
- HTML5+CSS3網(wǎng)站設(shè)計(jì)基礎(chǔ)教程
- Linux操作系統(tǒng)基礎(chǔ)案例教程
- Bootstrap 4 Cookbook
- Web性能實(shí)戰(zhàn)
- Spring Security Essentials
- 物聯(lián)網(wǎng)系統(tǒng)架構(gòu)設(shè)計(jì)與邊緣計(jì)算(原書第2版)
- 深度學(xué)習(xí)入門:基于Python的理論與實(shí)現(xiàn)
- 快樂編程:青少年思維訓(xùn)練
- Python GUI Programming Cookbook(Second Edition)