Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Reactive and Reactive Streams?

I'm trying to understand the difference between Reactive and ReactiveStreams, specifically in the context of RxJava ?

The most I could figure out was that Reactive Streams has some notion of backpressure in the specification but that already exists in RxJava/Reactive with the request(n) interface.

Wouldn't mind a ELI5 answer.

like image 251
Setheron Avatar asked Dec 20 '15 23:12

Setheron


People also ask

What is stream in reactive programming?

Reactive programming A stream is a sequence of ongoing events (state changes) ordered in time. Streams can emit three different things: a value (of some type), an error, or a "completed" signal.

What is non-blocking reactive streams?

Reactive Streams is an initiative to provide a standard for asynchronous stream processing with non-blocking back pressure. This encompasses efforts aimed at runtime environments (JVM and JavaScript) as well as network protocols.

Why is reactive programming called reactive?

Reactive programming creates software that responds to events rather than solicits inputs from users. An event is simply a signal that something has happened.

What is the relationship between streams and the observer pattern?

Observables This means, that the observable is the Subject being observed/subscribed to (see in the observer pattern above). You can also put it into other words: The stream is the “observable” being observed. You can subscribe to an observable (stream) and get updates on changes on the observable.


1 Answers

The design of Reactive Streams was a joint effort from several engineers to define a standard minimum set of components that support (potentially) asynchronous event delivery with backpressure (and synchronous cancellation). It was mainly influenced by RxJava in its design along with Akka.

However, the resulting design was significanlty different from RxJava so RxJava 1.x would require a lot of binary-incompatible changes to make itself compliant. Instead, we have an RxJavaReactiveStreams bridge and RxJava 2.0 was reimplemented by Reactive-Streams norms completely.

I have a four part blog series about Reactive-Streams in the light of RxJava.

like image 58
akarnokd Avatar answered Oct 04 '22 14:10

akarnokd