Asynchronous Events
Distributed Event Handling in RCommon.
Distributed (a.k.a. Integrated) events, in contrast to local events, are events which are raised and published with the express intent of having them distributed to and consumed by other applications that exist outside the in-memory process which raises them. The conduit by which these events are transported is called an Event Bus.
RCommon currently relies solely on MassTransit to distribute events along with the help of a simple distributed event broker which acts as a repository for any distributed events which are raised during the course of the application's runtime operations. The distributed event broker gives transactional control over when distributed events are published/dispatched.
Distributed events can easily be added to the DistributedEventBroker like this:
...and then can easily be published like this:
As seen above, the DistributedUnitOfWorkBehavior ties together the Unit of Work pattern with the DistributedEventBroker's publishing behavior to create a means of handling transactions and then distributing events as part of a transactional workflow.
Last updated