Seekyu 2.0.0
dotnet add package Seekyu --version 2.0.0
NuGet\Install-Package Seekyu -Version 2.0.0
<PackageReference Include="Seekyu" Version="2.0.0" />
paket add Seekyu --version 2.0.0
#r "nuget: Seekyu, 2.0.0"
// Install Seekyu as a Cake Addin
#addin nuget:?package=Seekyu&version=2.0.0
// Install Seekyu as a Cake Tool
#tool nuget:?package=Seekyu&version=2.0.0
Seekyu
Purpose
This project is aimed at giving you a lightweight framework for dispatching and handling Command-pattern objects and get results in a generic automated way.
Parts
It is comprised of two building blocks
- Dispatcher
- Handlers
The dispatcher is the central hub in which you register handlers for specific command/response pairs. In practice, you would have one dispatcher and multiple handlers.
In details, there are two types of dispatchers :
- Dispatcher<TDispatchable> : The base dispatcher which holds references to many handlers. Inherits from DecoratableDispatcher<TDispatchable>
- DelegatingDispatcher<TDispatchable> : A middleware dispatcher which decorates any DecoratableDispatcher (through syntactic sugar, see below).
Usage
Handlers
You have to define your own handlers which have to implement this interface :
namespace Seekyu
{
public interface IHandler<TDispatchable, TResult> where TDispatchable : IDispatchable
}
e.g. :
public interface IHitchickersQuery : IDispatchable { }
public class LifeUniverseAndEverythingQuery : IHitchickersQuery { }
public class GetAnswerToLifeHandler : IHandler<LifeUniverseAndEverythingQuery, int>
{
public int TryHandle(LifeUniverseAndEverythingQuery query)
{
return 42;
}
}
Dispatcher
You have to instantiate a Dispatcher<TDispatchable> for each dispatchable category (= interface) you want to have dispatched. Common usage is separation of ICommand and IQuery in two dispatchers. You give this Dispatcher instance an array of all the handlers you want it to browse when it needs to dispatch something. No two handlers for the same dispatchable/response types pair can be registered.
GetAnswerToLifeHandler deepThought = new GetAnswerToLifeHandler();
IHandler[] handlers = { deepThought };
Dispatcher<IHitchickersQuery> theGuide = new Dispatcher<IHitchickersQuery>(handlers);
And then you can dispatch your dispatchables:
theGuide.Dispatch<int>(new LifeUniverseAndEverythingQuery()); //Returns 42;
Product | Versions 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. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 12.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
2.0.0 :
- Moved project to .netStandard2.0