- Hands-On Reactive Programming in Spring 5
- Oleh Dokuka Igor Lozynskyi
- 386字
- 2021-07-23 16:36:21
RxJava as a reactive framework
For some time, there was a standard library for reactive programming on Java platforms—namely RxJava 1.x (see https://github.com/ReactiveX/RxJava for more details). That library paved the way for reactive programming as we know it in the Java world today. At the moment, it is not the only library of this kind; we also have Akka Streams and Project Reactor. The latter is covered in detail in Chapter 4, Project Reactor - the Foundation for Reactive Apps. So, currently, we have a few options from which we may choose. Furthermore, RxJava itself has changed a lot with the release of version 2.x. However, to understand the most basic concepts of reactive programming and the reasoning behind them, we will be focusing on the most fundamental part of the RxJava only, on the API, which has not changed since the early versions of the library. All examples in this section should work fine with both RxJava 1.x and RxJava 2.x.
To enable simultaneous usage in one application classpath, RxJava 2.x and RxJava 1.x have different group IDs (io.reactivex.rxjava2 versus io.reactivex) and namespaces (io.reactivex versus rx).
The RxJava library is a Java VM implementation of Reactive Extensions (also known as ReactiveX). Reactive Extensions is a set of tools that allows imperative languages to work with data streams, regardless of a stream being synchronous or asynchronous. ReactiveX is often defined as a combination of the Observer pattern, the Iterator pattern, and functional programming. A good starting point to learn more about ReactiveX is at http://reactivex.io.
Reactive programming may seem to be difficult, especially when we are approaching it from the imperative world, but the main idea is actually straightforward. Here, we are going to learn the basics of RxJava as the most wide-spread reactive library to date. We are not going to dive into all of the details, but try to walk through all the vital concepts of reactive programming.
- 社交網(wǎng)絡(luò)對齊
- Django 2 by Example
- 物聯(lián)網(wǎng)安全與深度學(xué)習(xí)技術(shù)
- 中國互聯(lián)網(wǎng)發(fā)展報(bào)告2018
- Working with Legacy Systems
- 物聯(lián)網(wǎng)場景設(shè)計(jì)與開發(fā)(初級)
- Scala Design Patterns.
- 端到端QoS網(wǎng)絡(luò)設(shè)計(jì)
- 人人都該都懂的互聯(lián)網(wǎng)思維
- 網(wǎng)絡(luò)空間全球治理觀察
- LwIP應(yīng)用開發(fā)實(shí)戰(zhàn)指南:基于STM32
- Web用戶查詢?nèi)罩就诰蚺c應(yīng)用
- 現(xiàn)場綜合化網(wǎng)絡(luò)運(yùn)營與維護(hù):運(yùn)營商數(shù)字化轉(zhuǎn)型技術(shù)與實(shí)踐
- 智能物聯(lián)網(wǎng):區(qū)塊鏈與霧計(jì)算融合應(yīng)用詳解
- 巧學(xué)活用CISCO網(wǎng)絡(luò)典型配置