Talkatives.Extensions.Messaging.Dataflow
1.0.0
dotnet add package Talkatives.Extensions.Messaging.Dataflow --version 1.0.0
NuGet\Install-Package Talkatives.Extensions.Messaging.Dataflow -Version 1.0.0
<PackageReference Include="Talkatives.Extensions.Messaging.Dataflow" Version="1.0.0" />
<PackageVersion Include="Talkatives.Extensions.Messaging.Dataflow" Version="1.0.0" />
<PackageReference Include="Talkatives.Extensions.Messaging.Dataflow" />
paket add Talkatives.Extensions.Messaging.Dataflow --version 1.0.0
#r "nuget: Talkatives.Extensions.Messaging.Dataflow, 1.0.0"
#:package Talkatives.Extensions.Messaging.Dataflow@1.0.0
#addin nuget:?package=Talkatives.Extensions.Messaging.Dataflow&version=1.0.0
#tool nuget:?package=Talkatives.Extensions.Messaging.Dataflow&version=1.0.0
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.
- This promotes loose coupling between various components wich allows for asynchronously communication within a process space.
- This can also be extended across process spaces using forwarding mechanisms.
- This allows each component to autonomously evolve without worrying about how other componenets change.
- Introduces messaging as a first class citizen within an application domain.
- 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
Add the nuget package Talkatives.Extensions.Messaging.Dataflow and register the publisher in the pub component and the subscriber in the sub component
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 {...});
- 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 | Versions 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. |
-
net5.0
- Microsoft.Extensions.DependencyInjection (>= 5.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 5.0.0)
- Talkatives.Extensions.Messaging.Abstractions (>= 1.0.0)
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.0.0 | 525 | 11/5/2021 |