Reactive programming with Reactor

Just like the ReactiveX Framework, Reactor is also a fourth-generation reactive programming library. It allows you to write non-blocking reactive apps. However, it has some significant differences as compared to ReactiveX, as listed here:

  • Unlike ReactiveX, which supports several platforms and languages (for example, RxSwift for Swift, RxJava for JVM, RxKotlin for Kotlin, RxJS for JavaScript, RxCpp for C++, and so on), Reactor supports only JVM.
  • You can use RxJava and RxKotlin, if you have Java 6+. However, to use Reactor, you need Java 8 and above.
  • RxJava and RxKotlin doesn't provide any direct integration with Java 8 functional APIs, such as CompletableFuture, Stream, and Duration, which Reactor does.
  • If you're planning to implement reactive programming in Android, you have to use RxAndroid, RxJava, and/or RxKotlin (collectively, ReactiveX) or Vert.X, unless you have minimum SDK as Android SDK 26 and above, that too without official support. As reactor project doesn't have official support on Android and it works only on Android SDK 26 and above.

Other than these differences, Reactor and ReactiveX APIs are quite similar, so get started by adding Reactor to your Kotlin project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.117.191