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

Adding Reactor to the project

Here, we assume that the reader is already familiar with the Reactive Streams specification. If not, it is briefly described in the previous chapter. The Reactive Streams specification is essential in the current context, because Project Reactor is built on top of it and org.reactivestreams:reactive-streams is the only mandatory dependency of Project Reactor.

Adding Project Reactor as a dependency to our application is as simple as adding the following dependency to the build.gradle file:

compile("io.projectreactor:reactor-core:3.2.0.RELEASE")

At the time of writing, the latest version of the library is 3.2.0.RELEASE. This version is also used in Spring Framework 5.1.

The procedure for adding the Project Reactor library to a Maven project is described in the following article: https://projectreactor.io/docs/core/3.2.0.RELEASE/reference/#_maven_installation.

It is also often worth adding the following dependency, as this provides the necessary toolset for testing reactive code, which, obviously, we also need to cover with unit tests: 

testCompile("io.projectreactor:reactor-test:3.2.0.RELEASE")  

In this chapter, we are going to use some simple testing techniques for Reactive Streams. Additionally, Chapter 9Testing the Reactive Application, covers topics regarding reactive code testing in more detail.

Now that we have Reactor in our application classpath, we are ready to experiment with Reactor's reactive types and operators.

主站蜘蛛池模板: 道真| 米泉市| 长岭县| 屯门区| 临沭县| 柘荣县| 中牟县| 安仁县| 高安市| 铁岭县| 休宁县| 芮城县| 方正县| 怀安县| 清水县| 绥江县| 泗阳县| 海原县| 新丰县| 临颍县| 瓦房店市| 阜康市| 昌乐县| 星座| 孟津县| 平安县| 安福县| 伊吾县| 休宁县| 石阡县| 龙江县| 乐都县| 鄂托克前旗| 金昌市| 翁牛特旗| 庆元县| 苍梧县| 巴彦县| 明水县| 蛟河市| 新田县|