LightMediator 0.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package LightMediator --version 0.2.0
                    
NuGet\Install-Package LightMediator -Version 0.2.0
                    
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="LightMediator" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LightMediator" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="LightMediator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LightMediator --version 0.2.0
                    
#r "nuget: LightMediator, 0.2.0"
                    
#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.
#:package LightMediator@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LightMediator&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=LightMediator&version=0.2.0
                    
Install as a Cake Tool

LightMediator

LightMediator is a lightweight library designed to simplify decoupled communication in distributed Windows services. It works with multiple notification types and supports services across different namespaces.

Features

  • Lightweight and efficient.
  • Supports publish-subscribe, request-response, and one-way notifications.
  • Simplifies working with decoupled services in distributed systems.
  • Easy to integrate with existing applications.

Installation

You can install the LightMediator NuGet package using the following command:

dotnet add package LightMediator

Usage

Publish Notifications

You can publish notifications to subscribers using the LightMediator instance:

var mediator = new LightMediator();
mediator.Publish(new Notification("ServiceStarted"));

Handle Notifications

To handle notifications, create a class that implements the INotificationHandler<T> interface. Ensure that Notification implements the INotification interface:

public class Notification : INotification
{
    public string Message { get; }

    public Notification(string message)
    {
        Message = message;
    }
}

public class NotificationHandler : INotificationHandler<Notification>
{
    public Task Handle(Notification notification, CancellationToken cancellationToken)
    {
        Console.WriteLine($"Received: {notification.Message}");
        return Task.CompletedTask;
    }
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LightMediator:

Package Downloads
LightMediator.EventBus

EventBus capability to publish events between applications using different messaging systems

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.2 125 9/9/2025
0.5.1.4 340 5/23/2025
0.5.1.3 178 5/21/2025
0.5.1.2 161 5/21/2025
0.5.1.1 151 5/20/2025
0.5.1 344 5/13/2025
0.5.0 237 5/12/2025
0.4.8 218 2/26/2025
0.4.7 123 2/26/2025
0.4.6 129 2/11/2025
0.4.5 113 2/11/2025
0.4.4 119 2/11/2025
0.4.3 116 2/11/2025
0.4.2 187 2/3/2025
0.4.1 120 2/3/2025
0.4.0 147 2/2/2025
0.3.0 114 1/25/2025
0.2.0 103 1/24/2025
0.1.0 103 1/24/2025

- Add option for full notification name mapping