A framework which helps to implement the Observer pattern.
Go to file
Alexander Kozachenko 0f1af2a954 Fixed namespaces
Added Acting
Fixed readme

Released 4.0
2023-12-08 06:33:55 +03:00
docs 4.0.0-rc.9.0 - removed ISubscriber (#20) 2023-12-07 23:31:37 +00:00
pack Fixed namespaces 2023-12-08 06:33:55 +03:00
src Fixed namespaces 2023-12-08 06:33:55 +03:00
tests Fixed namespaces 2023-12-08 06:33:55 +03:00
.gitignore added gitignore 2023-11-16 08:06:54 +03:00
Directory.Build.targets Fluent Translators (#11) 2023-11-30 16:04:49 +00:00
LICENSE Initial commit 2023-11-16 05:04:03 +00:00
Messaging.code-workspace Fluent Translators (#11) 2023-11-30 16:04:49 +00:00
Messaging.sln Fixed namespaces 2023-12-08 06:33:55 +03:00
README.md Fixed namespaces 2023-12-08 06:33:55 +03:00

README.md

ProSol.Messaging

Implements a message broker with ability to build a pipeline of listeners.

For example, let's make a pipeline which detects future and past dates:

Add package:

dotnet add package ProSol.Messaging --version 4.0
using ProSol.Messaging;
using ProSol.Messaging.Filtering;
using ProSol.Messaging.Acting;

var provider = new PipelineMessagePublisher<DateTime>();

provider
    .Endpoint(x => x >= DateTime.Now)
    .Act(x => Console.WriteLine($"Future: {x}"));

provider
    .Act(x => Console.WriteLine($"Past: {x}"));

provider.Publish(DateTime.Today.AddDays(1));
provider.Publish(DateTime.Today.AddDays(-1));

Try this and you will see two messages in the console, with dates, depending on your current time:

Future: ...
Past: ...

That's it! It's basically a pipeline builder for dispatching the messages.

There are some more extension methods for dispatching, you may find there:

Happy coding!