Reactive Programming is event-based in most cases. In Reactive Programming, the APIs are exposed in the following two flavors:
Callback: In this type, the anonymous routines are registered to event sources as callback functions. They will be invoked when the event is triggered by the data flow.
Declarative: The events are observed through well-defined functional compositions, like a filter, map, and other stream-based operations, like count, trigger, and so on.
Reactive Programming puts the importance on data flow rather than the flow of control, so it is not uncommon to consider it as a data flow programming. There are various techniques that are used to achieve Reactive Programming as follows:
Futures and promise: It is referred to as a technique to define the variable and assign its value. Though futures and promise are used interchangeably, they are not exactly the same. The future is used to describe a read-only view of a variable (or, say, define the variable), while the promise is a writable, single assignment container that is used to set the value of a variable in future.
Reactive Streams: It is defined as a standard for the processing of asynchronous streams that enables non-blocking, backpressure transmutations between sources from where the events are initiated and the destination where they are observed.
Data flow variables: It is a variable whose value depends on a given input, operations, and other cells, and is updated automatically when changes happen to source entities. You can think of a data flow variable as a spreadsheet cell, where a change in the value of one cell causes a ripple effect to others based on the assigned formula.