I have been hearing this term for a while now, but don't exactly know what it is. Would love to hear a lucid explanation.
The introduction to Reactive Programming you've been missing
Also Andre Stalz is reactive programming expert, follow him for things related to Reactive Programming. He has also given a lot of talks related to Reactive Programming, you can watch them for getting started!
If you know JavaScript you must have realized the awesomeness of this programming language. The event model is one of the strongest pillar to make JavaScript so popular. The publisher-subscriber design(also known as observer pattern) takes this event model to one step further where clients can register them selfs to a event publisher. Any number of client can register themselves as subscriber. Publisher then notifies the subscriber for each message it published.When client do not want the subscribed message anymore it can unregister itself from the publisher. In total it provides freedom to both publisher and subscriber to define there own boundary and helped them to loosely coupled. in return helps a developer to implement separate the concerns of logic.
The reactive programming advances the observer pattern where a controlled Asynchronous data flow stream can be implemented.Reactive programming enables applications to make more real-time responsive.
For a quick and inspiring intro, I'd suggest you to watch and enjoy Netflix's take on Async programming, because well presented examples built one at a time make it so obvious:
All good answers here already.
What I still miss on any explanation here and elsewhere, is the fact that reactive programming can be described or even is a superset of state machines.
Describing what happens to what type of incoming data is the same like describing, from what state you can transition into another state. The only difference I feel is that in reactive programming you most often deal with a steady stream of data. Making a state machine processing streams, is what all people call reactive programming. I might be wrong with that observation but thinking like streamed state machine helped me understand how reactive programming works.
Thanks for the response.
@saan I get the observer pattern, Could you elaborate this a little bit "The reactive programming advances the observer pattern where a controlled Asynchronous data flow stream can be implemented."
Samuel Oloruntoba
Java is to JavaScript what Car is to Carpet.
Reactive programming basically has to do with the flow of data in an application. Take for example you want to make coffee but you do not have milk. There are several ways to do this
Or you could do
The first method is obviously more efficient than the latter. Why did I give this example? The first example works on the same principle as javascript(asynchronous) requests. While the second is a blocking mechanism.
Another example of reactive programming is Pub-sub(publisher-subscriber), one or more subscribers listen for a publisher and reacts according to the data provided by the publisher. A subscriber is not bound to a publisher, it can easily remove itself from listening to the publisher. Provides a lot more freedom and is reactive.
Basically you can say reactive programming is making a set of linear instructions into an asynchronous bunch.