What is Reactive Programming?

Card Puncher Data Processing

About

Reactive Programming is an event-driven programmation based on the observer / subscriber pattern via an event loop.

They are reactive implementing a reactor pattern.

It means that:

  • functions create events
  • functions subscribe to event

In another word, a change of state is propagated to the system where functions can react to them.

Event example

Backend

Some backend example events are:

  • a timer has fired
  • some data has arrived on a socket,
  • some data has been read from the disk
  • an exception has occurred
  • an HTTP server has received a request

Frontend

Some frontend example events are:

  • the user has clicked on a button
  • the user has swiped
  • the user has used a key
  • the scroll is at the end of the page

Example

Imperative Programming vs Reactive programming

In an imperative programming setting, the expression a:=b+c would mean that a is being assigned the result of b+c in the instant the expression is evaluated, and later, the values of b and c can be changed with no effect on the value of a.

On the other hand, in reactive programming, the value of a is automatically updated whenever the values of b or c change, without the program having to re-execute the statement a:=b+c to determine the presently assigned value of a.

Application

Reactive Application are event-driven data application.

Example of reactive / event driven data application:

Model

Implementation

Most reactive system are implemented via an event loop.

Manifesto

https://www.reactivemanifesto.org/ 1)





Discover More
Imperative Vs Functional
Code - Imperative Programming

Imperative vs Functional mariofusco/status/571999216039542784 Imperative vs reactive programming In an imperative programming setting, the expression a:=b+c would mean that a is being assigned the...
Card Puncher Data Processing
Data Processing - Reactive Stream Processing

Reactive Streams is the standard/specification for reactive data processing (ie observer, asynchronous processing) The characteristics are: functional programming fashion non-blocking backpressure...
Card Puncher Data Processing
Design Pattern - Observer (Publish-subscribe model|Pub Sub)

An observer makes a observation by creating an event and passing it to a callback method of the subscriber. The observer is also called a message broker because it dispatches the event (ie message) to...
Card Puncher Data Processing
Microsoft Excel

Excel is a spreadsheet tool that you can categorize in the desktop database. It's a reactive tool (a cell update is reflected in all dependent cell). Lukas...
Event Centric Thinking
Stream - Processing

Stream processing is the reactive design of data processing. Something happened (Event), Subscribe to it (Streams) Streaming Processing is also known as : Incremental Processing. or reactive...
Card Puncher Data Processing
The Art of Programming - Information System and Software Design

The Art of Programming - Information System and Software Design This section is about how to use the basic block of a language in order to create high order component. Abstract:_The_Art_of_DesignThe...
Java Conceptuel Diagram
Vert.x - Verticle

Verticles are the technical units of deployments of code in Vert.x. Verticles share certain similarities with actors in the actor model. Verticles communicate with each other by generating messages...
Card Puncher Data Processing
What is Reactive Programming?

Reactive Programming is an event-driven programmation based on the observer / subscriber pattern via an event loop. They are reactive implementing a reactor pattern. It means that: functions create...
On Off Automaton
What is State? Data and Programming

State are the attribute values of a thing (entity) at a given moment. A State can be seen as a snapshot of values at a precise moment. Edson...
Card Puncher Data Processing
What is an Event Loop?

An Event loop is a thread that waits for and dispatches events or messages that may contains: data or runnable code An event loop is also known as: message dispatcher, message loop, message...



Share this page:
Follow us:
Task Runner