Support async
The handler interface does not support async implementations. Either add a new async method implementation or replace existing one to return a Task.
Add async wherever else it makes sense as well.
+1 just stumbled into a situation, where I needed to call async/await code from the HandleMessage callback. It turns out that just creating a Task via calling an async method seems to work in a console app, however I’m not at all sure that this is the correct sync/async transition. Does the code need to wait for completion? What about exceptions? SynchronisationContext? Does it drain the queue and re-queue all messages in the ThreadPool queue? Does it deadlock itself?
Yes, I guess there is need for either a comprehensive example or even better an async compatible message handler.