Add mechanism for event driven app to wait efficiently
We've been designing for real-time apps that "tick" on a relatively high frequency, and that will poll for messages at this interval.
We should provide a mechanism for apps that don't fit this model, e.g. the more traditional event-driven server model where you select()/poll() and then wake up and process the event immediately.
I think the simplest way to do this is to provide a config parameter that specifies a callback when a new message arrives. The intention would be that the app would use some mechanism (e.g. set an event on windows) to wake up their other thread that is actually going to do the work. I'm worried that somebody will actually try to process the message in the callback, and that would probably be bad. If necessary, we could put these callbacks on another thread, so that they cannot shoot themselves in the foot by doing dumb stuff.