Publish any asynchronous event on application and take it from multiple consumers

EventBrokR is dependency injectable, EventBrokR deal with dynamics event and anonymous consumers

Installing

You can download EventBrokR from NuGet in Visual Studio, With Package Manager Console type:

PM> Install-Package EventBrokR

Example :

  • Setup publisher

var eb = new Publisher();
  • MyEvent

public class MyEvent
{
     public string Message { get; set; }
}
  • MyConsumer

public class MyConsumer : IConsumer<MyEvent>
{
     public void Handle(MyEvent @event)
     {
          Console.WriteLine(@event.Message);
     }
}
  • Register consumer

eb.Container.Register<MyConsumer>();
  • Publish Event

var @evt = new MyEvent() { Message = "Test" };
eb.PublishAsync(@evt);

Last edited Nov 26, 2013 at 4:13 PM by mchouteau, version 11