ReactiveX

ReactiveX is a library for asynchronous and event-driven programs. It supports sequences of data and events by extending the observer pattern. It has operators that allow declaring sequences while being free of worries regarding things such as low-level threading, thread safety, synchronization, and non-blocking IOs. ReactiveX is functional, reactive, and operates on discrete values that have changed over time.

The ReactiveX Observable model was designed to help you deal with asynchronous events as easily as arrays. It removes the complexity of the callback, making your code more readable and less vulnerable to bugs. Some of the advantages of the ReactiveX Observable model are:

  • Composable: The ReactiveX Observable model makes creating a flow of asynchronous events very easy and helps compose their flows and the sequence of the event. Although other techniques, such as Java Future, are very straightforward for the use of asynchronous events, they add unnecessary non-trivial complexity.
  • Flexible: This model supports many different types of values instead of just scalar values. This allows the model some flexibility and elegance that helps in other use cases.
  • Less opinionated: The observable model can be implemented using thread loops, event loops, non-blocking I/O, or whatever implementation meets your requirements. It is not biased toward particular sources of concurrency and asynchronicity.
  • No callbacks: Callbacks create a lot of problems in the code when used with the nested execution of asynchronous events.
  • Polyglot implementation: ReactiveX is implementing a number of different languages in the Observable model.

Let's see another pattern for making a system reactive and event-driven asynchronous.

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

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