I have a system in place where a Cache is made up of many Cache Nodes. When one is added, a CacheNodeAdded event is raised by the Cache. The Cache has a redundant set of Monitors listening for this event. Monitors are responsible for notifying on Cache events.
Since I have multiple Monitors, but only want to be notified once, Step 3 is what I am looking to implement.
Solutions I can't use:
- Cache notifying directly. Monitors must be used.
- Have each Monitor check the log to see if the notification has been sent. Since they all run separately, they could all access the list of notifications at the same time, see the notification hasn't been sent, and notify multiple times as a result.
Solution I'm toying with:
- When event is received, get a list of all Monitor IDs (GUID), order the list, and the first Monitor in the list gets to send the notification. This is a simple solution but it seems a little inelegant.
Are there any other simple solutions that I may be overlooking?