Stark.MessageBroker 1.0.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Stark.MessageBroker --version 1.0.0.4
NuGet\Install-Package Stark.MessageBroker -Version 1.0.0.4
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="Stark.MessageBroker" Version="1.0.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Stark.MessageBroker --version 1.0.0.4
#r "nuget: Stark.MessageBroker, 1.0.0.4"
#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 Stark.MessageBroker as a Cake Addin
#addin nuget:?package=Stark.MessageBroker&version=1.0.0.4

// Install Stark.MessageBroker as a Cake Tool
#tool nuget:?package=Stark.MessageBroker&version=1.0.0.4

Message-Broker

A simple, asynchronous, in-memory message broker that provides publish/subscribe functionality between loosely coupled components.

The library makes use of LibLog to provide logging abstraction. For more information, see: https://github.com/damianh/LibLog.

Usage

Messages are posted and subscribed to by type, with the ability to execute custom actions for each message type.

In the most basic example, a generic message with no data is posted to the broker and forwarded to subscribers, with each function passed in the subscription executed.

// Message class
public class GenericMessage : Message
{
}

// Subscribe to messages and perform action when received
broker.Subscribe<GenericMessage>(() =>
                                 {
                                     // do interesting things...
                                     return Task.CompletedTask;
                                 },
                                 "subscription name");

// Post message
await broker.PostAsync<GenericMessage>();

Message Broker also supports posting messages with instance data, which is then available to the executed function.

// Message class
public class FooMessage : Message<Foo>
{
}

// Subscribe to messages and perform action when received
broker.Subscribe<FooMessage>(fooMsg =>
                            {
                                var data = fooMsg.Data.Data;
                                // do interesting things with data...
                            },
                            "subscription name");

// Post message
await broker.PostAsync(new FooMessage());
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.0.3.17936 74 4/3/2024
2.0.3.17930 70 4/3/2024
2.0.3.13052 2,498 4/6/2023
2.0.3.6693 3,169 4/6/2022
2.0.2.1934 5,020 8/2/2021
2.0.2.319 1,138 4/7/2021
2.0.1.1 3,888 10/8/2020
2.0.0.1 2,486 11/27/2019
1.0.1.7 464 11/7/2019
1.0.0.4 469 9/17/2019