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

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.

主站蜘蛛池模板: 宁城县| 河东区| 中牟县| 江门市| 高安市| 饶平县| 方城县| 鹰潭市| 易门县| 信阳市| 綦江县| 柳林县| 江山市| 洛浦县| 巩义市| 香格里拉县| 安义县| 麻江县| 新干县| 民和| 克拉玛依市| 陵川县| 虎林市| 嘉祥县| 明水县| 巴林右旗| 定远县| 宁国市| 天祝| 石泉县| 峨眉山市| 连山| 台北市| 昭觉县| 奉贤区| 南开区| 寿光市| 容城县| 正宁县| 钟祥市| 南投县|