Event streams

An event stream can be defined as a sequence of events happening over time; you can think of it as an asynchronous array. A simple description of an event stream is shown in the following diagram:

As you can see, we have expressed time on the arrow aligned from left to right, moving forward to the right, and events happen over time. The colored bubbles (indicated by their names) drawn at intermittent intervals on the timeline represent the events. We can add an event listener to the whole sequence and whenever an event happens, WE CAN REACT TO IT by doing something; that's the main idea!

We have numerous other types of sequence ...

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.