Reactive Programming
Reactive programming is when applications react to an asynchronous data stream as it occurs. The following image illustrates the flow:
Reactive programming is not a fancy software engineering term only used by academics. It is, in fact, a programming model that can result in much greater efficiencies as opposed to the more common method of having applications iterate over data that is in memory.
There is more to reactive programming. First, let's consider that the data stream is provided by a publisher in an asynchronous manner to the subscriber.
Note
Data streams are a binary input/output of strings and primitive data types. The DataInput
interface is used for an input stream and the DataOutput
interface is used for output streams.
Processors, or a chain of processors, can be used to transform the data stream without the publisher or subscriber being impacted. In the following example, the Processors work on the stream of data without Publisher or Subscriber involvement...