Subjects and Multicasting Operators
Learn about subjects and multitasking operators.
We'll cover the following...
Exploring subjects
Subjects are special types of observables. While plain observables are unicast, subjects are multicast. They allow multicasting values to all the subscribers. We can regard subjects as observers and observables at the same time.
We can subscribe to subjects to get emitted values by the producer (that’s why they act as observables).
We can send values and errors and complete the stream using the
next
,error
, andcomplete
methods (that’s why they act as observers).
Press + to interact
Remember that the observer interface has the next
, error
, and complete
methods to, respectively, send values, error out, and complete an execution. ...