官术网_书友最值得收藏!

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).

Even though the end-of-life for RxJava 1.x was in March 2018, it is still used in a handful of libraries and applications, mainly because of long-standing, wide-spread adoption. The following article provides a good description of what was changed in RxJava 2.x in comparison to RxJava 1.x:  .

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.

主站蜘蛛池模板: 五家渠市| 临江市| 大新县| 萍乡市| 玉林市| 绩溪县| 阿勒泰市| 定南县| 峨山| 平远县| 栾城县| 双流县| 任丘市| 新河县| 成武县| 渭南市| 锡林郭勒盟| 商都县| 麻江县| 大化| 逊克县| 清远市| 伊川县| 东兰县| 井研县| 芦山县| 富源县| 喀什市| 高阳县| 湘西| 涿鹿县| 兰坪| 札达县| 准格尔旗| 武邑县| 元氏县| 陇南市| 永寿县| 大渡口区| 大英县| 义乌市|