Event streams
In this section, we study the basic data-type that drives most computations in the Reactors framework: an event stream. Event streams represent special program values that can occasionally produce events. Event streams are represented by the Event[T] type.
Semantically, an event stream is very similar to the Observable type, which we saw in Chapter 6, Concurrent Programming with Reactive Extensions. As we will see, the main difference between Observable and Events is that an Observable object can generally be used from different threads, and even emit events across different threads when the observeOn method is used. An Events object, by contrast, can only be used inside the reactor that owns that event stream.
Tip
Never share an event ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access