I’m trying to figure out the best way to utilize Server Sent Event channels and such. Most of the examples I’ve found just use “home” or “*”, but I’m wondering if it would be best for each specific DTO to have it’s own channel based on this comment in the docs:
http://docs.servicestack.net/server-events#channels
As Request DTO names are unique in ServiceStack they also make good channel names which benefit from providing a typed API for free, e.g: typeof(Request).Name.
Or if the channel should be left as “home” or “*” and just handle different types of messages with NotifyUserId
The ways we plan on using SSE:
Server to Single User (for Browser Notifications, Alerts, Etc…)
User to User (various dispatcher to police officer updates / communications)
Server to entire Agency (an Agency has many users - for agency-wide global alerts)
Server to entire State (Texas, Louisiana, etc… for Amber Alerts, APB / All-Points Bulletin, etc…)
My initial thoughts are to subscribe each user to each channel via channel names like so:
[“BrowserNotification”, “DispatcherNotification”, “AgencyNotification”, “StateNotification”]
Maybe the StateNotification channel would simple be the state name, “Texas”
The AgencyNotification channel could be combined: “AgencyNotification:7323” for AgencyId 7323.
I feel like there may be a better way. Am I utilizing this correctly? What might be a good channel / selector structure given these various scenarios?