trbngr/Lokad-Cqrs-Extensions — pull request #3 by JeetKunDoug (2011-10-16 17:53:27+00:00)
Title: Switch to Using SynchronousDispatcher for event publishing.

Change to use synchronous dispatcher for several reasons:
1) If sending of events fails, using Synchronous Dispatcher allows Lokad infrastructure to catch exception and retry.
2) Even if you don't want Lokad to retry, your entire worker role can die unexpectedly if you fail to send the events back to a queue on the async background thread as it causes an appdomain-level unhandled exception to be thrown, which tears down the process. We found that after a few of these, Azure wouldn't actually restart our role, and we'd lose an entire node.
3) We're already doing Asynchronous work via queues, don't need to spin up new background threads just to send event messages.