BPL.Event.EventDispatcher 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package BPL.Event.EventDispatcher --version 1.0.1                
NuGet\Install-Package BPL.Event.EventDispatcher -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BPL.Event.EventDispatcher" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BPL.Event.EventDispatcher --version 1.0.1                
#r "nuget: BPL.Event.EventDispatcher, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BPL.Event.EventDispatcher as a Cake Addin
#addin nuget:?package=BPL.Event.EventDispatcher&version=1.0.1

// Install BPL.Event.EventDispatcher as a Cake Tool
#tool nuget:?package=BPL.Event.EventDispatcher&version=1.0.1                

Event dispatcher

EventDispatcher is a package Inspired by Symfony: A Flexible Event Management System based on Levan Ostrovski's article on medium.com

Understanding the EventDispatcher

The EventDispatcher, a potent element that facilitates effective event handling and communication across various components of an application, is at the core of event-driven architecture. The EventDispatcher acts as a focal point, managing events, alerting subscribers, and enabling decoupled communication. The EventDispatcher is built around events. They indicate important system events like user actions or state changes. Developers can decouple components by encapsulating these occurrences as events and enabling indirect communication between them via the EventDispatcher.Implementing the EventDispatcher:

How to use

1. Create an event as per the below example

    class Notification : IEvent
    {
        private readonly int UserId {get; private set;}

        public Notification(int userId)
        {
            this.UserId = userId;
        }
    }

2. Create EventSubscriber

    class NotificationSubscriber : IEventSubscriber<Notification>
    {
        public void HandleEvent(Notification @event)
        {
            Console.WriteLine("Notification event Intercepted");
        }
    }

3. Initialize EventDispatcher

/// Create new instance
EventDispatcher dispatcher = new EventDispatcher();
/// Pass Assembly information to automatically
/// find all subscribers
dispatcher.RegisterEventSubscribers(Assembly.GetExecutingAssembly());

dispatcher.Dispatch(new Notification(1998));
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.0 104 5/6/2024
1.3.0 101 5/6/2024
1.2.1 89 5/6/2024
1.2.0 104 5/5/2024
1.0.1 102 5/5/2024
1.0.0 118 5/4/2024