- Integrations
Integrations
The Observable
, Observer
and Subscription
implementation draws inspiration from the ReactiveX and reactive streams libraries and provides easy interoperability with them. For more information about these classes please see the quick tour primer.
RxScala
The ReactiveX scala driver (RxScala) provides extra composability of Observables
compared to the MongoDB Observable
implementation.
An example implicit based implementation can be found in the examples folder. This includes an implicit based conversion from Observable
to rx.Observable
and an example of it being used.
The example uses the Observable.apply(f: (Subscriber[T]) => Unit)
method to return a cold observable. It also implements the Producer
trait, so the Observable
can honor “Backpressure” when when using any of the backpressure operators.
Reactive Streams
The Reactive streams initiative provides interfaces that allow reactive stream based systems to interact. The API is similar to the MongoDB Observable
API but without the composability of the MongoDB implementation.
Converting from an Observable
to a Publisher
is a simple process and can be done in a few short lines of code. An implicit based conversion can be found in the examples folder.