IObservable interface
The IObservable
interface, the opposite of the IObserver
interface, has the task of handling message production and the observer
subscription. It routes right messages to the OnNext
message handler and errors to the OnError
message handler. As its life cycle ends, it acknowledges all the observers on the OnComplete
message handler.
To create a valid reactive observable
interface, we must write something that is not locking against user input or any other external system input data. The observable
object acts as an infinite message generator, something like an infinite enumerable of messages; although in such cases, there is no enumeration.
Once a new message is available somehow, observer
routes it to all the subscribers.
Get Reactive Programming for .NET Developers 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.