Saturday, October 19, 2024

Reactive Programming

 Why Reactive Programming


  1. It helps to create asynchronous programming.
It is basically used to create application which must require Data Stream, Functional Programming, Asynchronous Observer. 

Applications may required Reactive Programming
  1. Based on user setting retrieve data from database.
  2. create real-time stock website.
  3. Search result from auto-complete .
  4. Combines data from different sources and render into UI.
Why To use Reactive Programming
  1. Many android application
  2. By google
  3. Netflix, Microsoft, Github, and so on.
Implementation of Reactive Programming Language
There are lot of implementation, out of the most popular is Reactive eXtension (or ReactiveX).
And we have lot of programming language which give API implementation for ReactiveX. Some of the examples are:
  1.  RxJava - Java
  2. RxPy - Python 
Subject/Subscriber:
Which produce data or its a stream which produces/emits data continuously.
Observer: 
WHich consumes/subscribe to data. There can be multiple Observer for single Subject. 
Function:
Which manipulates the data comes from Subject and gives to Observer.

In someway we can say its following Observer Design pattern.

A Sample reactive programming in RxJAVA:

https://github.com/chandan1989/reactiveprogramming

Reactive Programming

  Why Reactive Programming It helps to create asynchronous programming. It is basically used to create application which must require Data S...