- Hands-On Reactive Programming in Spring 5
- Oleh Dokuka Igor Lozynskyi
- 209字
- 2021-07-23 16:36:31
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.
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 9, Testing 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.
- 通信網(wǎng)絡(luò)基礎(chǔ)與設(shè)備
- EJB 3.1從入門到精通
- GPS/GNSS原理與應(yīng)用(第3版)
- 物聯(lián)網(wǎng)時(shí)代
- Mastering TypeScript 3
- 中國互聯(lián)網(wǎng)發(fā)展報(bào)告2018
- C/C++串口通信:典型應(yīng)用實(shí)例編程實(shí)踐
- CCNP TSHOOT(642-832)認(rèn)證考試指南
- 網(wǎng)絡(luò)環(huán)境中基于用戶視角的信息質(zhì)量評價(jià)研究
- SAE原理與網(wǎng)絡(luò)規(guī)劃
- 局域網(wǎng)組成實(shí)踐
- 一本書讀懂物聯(lián)網(wǎng)
- 現(xiàn)代通信系統(tǒng)(第5版)
- 全聯(lián)網(wǎng)標(biāo)識服務(wù)
- NB-IoT原理和優(yōu)化