In simple terms, a subscriber registers with a provider so that the subscriber may get notifications related to the message information. These notifications notify the provider that messages have been delivered to subscribers. This information may also be related to changes in operations or any other changes in the method or object itself. This is also known as state changes.
Observer pattern – implementation using IObservable<T>
The observer pattern specifies two terms: Observer and Observable. The observable is a provider also known as the subject. The observer is registered with the Observable/Subject/Provider types, and the observer will be automatically notified by the provider whenever any changes occur due to the pre-defined criteria/condition, ...
Get Hands-On Design Patterns with C# and .NET Core 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.