JKang.EventBus.InMemory 1.0.0

.NET Core ultra lightweight event bus implementation

Install-Package JKang.EventBus.InMemory -Version 1.0.0
dotnet add package JKang.EventBus.InMemory --version 1.0.0
<PackageReference Include="JKang.EventBus.InMemory" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JKang.EventBus.InMemory --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

JKang.EventBus

A .NET Core ultra lightweight in-memory event bus implementation.

NuGet packages

Sample:

  1. Create an event class
    public class MessageSent
    {
        public MessageSent(string message) => Message = message;

        public string Message { get; }
    }
  1. Implement as many event handlers as you like
    public class MessageSentEventHandler : IEventHandler<MessageSent>
    {
        public Task HandleEventAsync(MessageSent @event)
        {
			Console.WriteLine(@event.Message)
            return Task.CompletedTask;
        }
    }
  1. register event handlers in IServiceCollection
    // Startup.cs
    public void ConfigureServices(IServiceCollection services)
    {
        services
            .AddEventBus()
            .UseInMemory()
            .AddEventHandler<MessageSent, MessageSentEventHandler>()
        ;
    }
  1. Publish the event
    await _eventPublisher.PublishEventAsync(new MessageSent("Something happened!"));

Any contributions or comments are welcome!

JKang.EventBus

A .NET Core ultra lightweight in-memory event bus implementation.

NuGet packages

Sample:

  1. Create an event class
    public class MessageSent
    {
        public MessageSent(string message) => Message = message;

        public string Message { get; }
    }
  1. Implement as many event handlers as you like
    public class MessageSentEventHandler : IEventHandler<MessageSent>
    {
        public Task HandleEventAsync(MessageSent @event)
        {
			Console.WriteLine(@event.Message)
            return Task.CompletedTask;
        }
    }
  1. register event handlers in IServiceCollection
    // Startup.cs
    public void ConfigureServices(IServiceCollection services)
    {
        services
            .AddEventBus()
            .UseInMemory()
            .AddEventHandler<MessageSent, MessageSentEventHandler>()
        ;
    }
  1. Publish the event
    await _eventPublisher.PublishEventAsync(new MessageSent("Something happened!"));

Any contributions or comments are welcome!

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 313 11/15/2018