I'm currently looking at adding some sort of notification mechanism server-to-client style to a ServiceStack based web service. My solution is based on HttpListener and so far it's also perfectly able to run on mono, so ideally I'm looking for options that preserve this.
Some suggestions that I have come across were the following:
- implement long-polling or comet-style requests that keep the response open to allow to push information bits down to the client
- integrate SignalR into the solution, which seems a little difficult but would match the problem
- bundle the service with a node.js server that handles only this type of notification.
Now I'm looking for the easiest solution for this. Demis mentions that long-polling will happily serve in the 100s of concurrent connections which would be perfectly sufficient (unless it doesn't block these user's "normal" operations). However I have no clue how to go about to implement something like this. Is there any example available or how would I go build this?
SignalR as the second option looks tempting. However if I were to host this in the same process (and also http port), I would need the respective HttpListeners filter by a virtual directory, which I couldn't get to work with ServiceStack (I have fiddled around ServiceStackHttpHandlerFactory.GetHandlerForPathInfo but to no avail so far). However I would get back to this option if (1) is not the way to go. Integrating node.js at the moment isn't really an option as it would complicate deployment a lot not, to mention development itself.
I'd be happy to hear how others have solved this and what would be the best option to choose.
Best regards,
Helge