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

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.

主站蜘蛛池模板: 玛纳斯县| 仁布县| 三江| 东平县| 安图县| 车险| 阿克苏市| 渑池县| 荣成市| 锡林浩特市| 施甸县| 新化县| 辛集市| 华阴市| 田东县| 馆陶县| 汨罗市| 靖江市| 会东县| 阜新| 鄱阳县| 米脂县| 勐海县| 阿城市| 东阿县| 涟水县| 荆州市| 琼结县| 高阳县| 平和县| 团风县| 普安县| 湾仔区| 铜陵市| 治县。| 名山县| 同仁县| 余干县| 漳平市| 九龙坡区| 巧家县|