Talkatives.Extensions.Messaging.Abstractions 1.0.0

dotnet add package Talkatives.Extensions.Messaging.Abstractions --version 1.0.0
                    
NuGet\Install-Package Talkatives.Extensions.Messaging.Abstractions -Version 1.0.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="Talkatives.Extensions.Messaging.Abstractions" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Talkatives.Extensions.Messaging.Abstractions" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Talkatives.Extensions.Messaging.Abstractions" />
                    
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 Talkatives.Extensions.Messaging.Abstractions --version 1.0.0
                    
#r "nuget: Talkatives.Extensions.Messaging.Abstractions, 1.0.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 Talkatives.Extensions.Messaging.Abstractions@1.0.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=Talkatives.Extensions.Messaging.Abstractions&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Talkatives.Extensions.Messaging.Abstractions&version=1.0.0
                    
Install as a Cake Tool

InProcessMessaging

InProcessMessaging defines a lightweight infrastructural component that allows different components within a system to interact in a messaging (pub/sub) fashion as opposed to using dependency injection and resolution.

  1. This promotes loose coupling between various components wich allows for asynchronously communication within a process space.
  2. This can also be extended across process spaces using forwarding mechanisms.
  3. This allows each component to autonomously evolve without worrying about how other componenets change.
  4. Introduces messaging as a first class citizen within an application domain.
  5. Typical use cases include background processing using fire and forget mechanisms.

Installation

Nuget package is avaialble on nuget.org

Using nuget package manager or the console you can add the nuget to your project.

PM> Install-Package Talkatives.Extensions.Messaging.Dataflow -Version 1.0.0

Getting Started

  1. Add the nuget package Talkatives.Extensions.Messaging.Dataflow and register the publisher in the pub component and the subscriber in the sub component

  2. Setup Publisher

//Registering the publisher. Note that while registering you dont need to specify the type of publisher
services.RegisterGenericInProcPublisher(new InprocMessageBusConfiguration
           {
               PublisherQueueSize = 100,
               PublishTimeoutMSec = 10000
           });



 //Resolving the publisher and publishing a string message
 var bus = _serviceProvider.GetService<IInprocMessageBus<string>>();
 bus.Publish($"Hello");

 //Resolving the publisher and publishing a PersonAdded event
   var bus = _serviceProvider.GetService<IInprocMessageBus<PersonAdded>>();
 bus.Publish(new PersonAdded {...});
  1. Setup subscriber
//Inherit from IInprocMessageSubscriber to implement consumers
public class Consumer01<string> : IInprocMessageSubscriber<string>
{
   public async Task OnNextAsync(string message)
       {
         //message processing logic goes here...


public class Consumer02<string> : IInprocMessageSubscriber<string>
{
   public async Task OnNextAsync(string message)
       {
         //message processing logic goes here...



//Register one or more consumers by type of messages being published
services.AddSingleton<IInprocMessageSubscriber<string>, Consumer01<string>>();
services.AddSingleton<IInprocMessageSubscriber<string>, Consumer02<string>>();

Contributions

PRs and feedback are welcome!

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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.  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.
  • net5.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Talkatives.Extensions.Messaging.Abstractions:

Package Downloads
Talkatives.Extensions.Messaging.Dataflow

Messaging Dataflow (pub-sub) is a library that implements a version of messaging abstractions using Dataflow components. This promotes and streamline the use of an eventing model within a service. This brings the advantage of decoupling that eventing provides across services to a single service.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 985 11/4/2021