ITMinds.HangfireMediator
0.2.0
See the version list below for details.
dotnet add package ITMinds.HangfireMediator --version 0.2.0
NuGet\Install-Package ITMinds.HangfireMediator -Version 0.2.0
<PackageReference Include="ITMinds.HangfireMediator" Version="0.2.0" />
paket add ITMinds.HangfireMediator --version 0.2.0
#r "nuget: ITMinds.HangfireMediator, 0.2.0"
// Install ITMinds.HangfireMediator as a Cake Addin
#addin nuget:?package=ITMinds.HangfireMediator&version=0.2.0
// Install ITMinds.HangfireMediator as a Cake Tool
#tool nuget:?package=ITMinds.HangfireMediator&version=0.2.0
IT Minds Hangfire Mediator Bridge
This library creates a simple bridge between MediatR and Hangfire enabling hangfire to be used under the hood as a schedule/background job runner of the mediator pattern.
Usage
Hangfire Service Registration
Be sure to add the UseMediatR
configuration extension for the Hangfire registration.
services.AddHangfire(configuration =>
{
configuration.SetDataCompatibilityLevel(CompatibilityLevel.Version_170);
// ...
configuration.UseMediatR();
});
Enqueueing jobs
Following the setup you can enqueue as part of the mediator pattern to run jobs in the background as part of the Hangfire queue system. All you have to do is instead of .Send
you write .Enqueue
.
mediator.Enqueue(new ExampleQuery { });
Optional: Setup recurring jobs
You can easily register recurring jobs like this:
using HangfireMediator;
public static IMediator SetupHangfireJobs(this IMediator mediator)
{
mediator.RecurringJob(
new ExampleQuery { },
"Hourly Example Query",
Cron.Hourly()
);
return mediator;
}
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. |
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.1.0 | 8,908 | 4/28/2022 | |
1.0.0 | 1,323 | 11/18/2021 | |
1.0.0-alpha.2 | 178 | 11/8/2021 | |
1.0.0-alpha.1 | 198 | 11/8/2021 | |
0.2.0 | 750 | 11/8/2021 | |
0.1.0 | 779 | 11/8/2021 |