Understanding and implementing notifications
There are several scenarios in the real world where clients need to receive asynchronous notifications. For example, when a check-in happens, the available room count reduces, and we need to notify all clients who might have enabled booking for our hotel on their sites to show current availability. Orleans provides a feature called client observers that helps to notify clients asynchronously. Let's configure and implement notifications in the next sub-section.
Implementing notifications in a grain
The mechanisms that allow a grain to notify clients asynchronously are called observers. An observer is an interface that inherits from IGrainObserver
and the client implementing IObserver
is called client observers. The grain will provide an API to subscribe or unsubscribe observers and send notifications to subscribed observers. Let's implement observer notifications step by step.
Step 1: Configuring the client to receive notifications...