Naravel.Queue.Redis
0.2.0
dotnet add package Naravel.Queue.Redis --version 0.2.0
NuGet\Install-Package Naravel.Queue.Redis -Version 0.2.0
<PackageReference Include="Naravel.Queue.Redis" Version="0.2.0" />
<PackageVersion Include="Naravel.Queue.Redis" Version="0.2.0" />
<PackageReference Include="Naravel.Queue.Redis" />
paket add Naravel.Queue.Redis --version 0.2.0
#r "nuget: Naravel.Queue.Redis, 0.2.0"
#:package Naravel.Queue.Redis@0.2.0
#addin nuget:?package=Naravel.Queue.Redis&version=0.2.0
#tool nuget:?package=Naravel.Queue.Redis&version=0.2.0
Naravel.Queue.Redis
Redis queue driver for Naravel.Queue, built on StackExchange.Redis - priority buckets, delayed jobs and automatic reclaim of jobs left behind by a crashed worker.
| Fact | Detail |
|---|---|
| Install | dotnet add package Naravel.Queue.Redis |
| Targets | .NET 10 |
| Needs | Naravel.Queue and Naravel.Redis, which NuGet installs with it |
| Driver | redis, added with AddRedisDriver |
What you get
- Ten priority buckets. Each queue keeps one ready list per priority, 0 to 9, and 9 comes out first.
- Delays and recovery in one pop. Each pop promotes the delayed jobs that are due and reclaims reserved jobs whose visibility timeout expired.
- Fenced reservations. A worker that outlives its visibility timeout cannot acknowledge the copy that another worker now owns; the job simply runs a second time.
- One connection with the rest of Naravel.
Connectionnames aNaravel.Redisstore, so the queue and the cache can share one connection. - Batches that outlive the process.
AddRedisBatchRepository()keeps batch state in Redis; the default tracking is in memory.
Quick start
{
"NaravelQueue": {
"Default": "redis",
"Stores": {
"redis": { "Driver": "redis", "ConnectionString": "localhost:6379", "VisibilityTimeoutSeconds": "300" }
}
}
}
using Naravel.Queue.Extensions;
using Naravel.Queue.Redis;
builder.Services.AddQueue(builder.Configuration).AddRedisDriver(builder.Configuration); // also registers Naravel.Redis
builder.Services.AddQueueWorker();
A store needs a ConnectionString, or a Connection that names a Naravel.Redis store whose connection the driver then reuses. VisibilityTimeoutSeconds (default 300) is how long a job may stay reserved by a worker that has disappeared before it goes back to the queue, so set it above your longest job. Failed jobs are kept in memory unless you add builder.Services.AddRedisFailedJobStore(), which keeps them in a Redis hash (netqueue:failed-jobs unless you pass another key).
Related packages
| Package | Adds |
|---|---|
Naravel.Queue |
Jobs, retries with backoff, chaining, batching and the background worker |
Naravel.Redis |
Named, shared Redis connections that the driver can borrow |
Learn more
- Queue: English guide
- Redis: English guide
- Changelog · Source and issues · MIT license
Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Naravel.Queue (>= 0.2.0)
- Naravel.Redis (>= 0.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Release notes: https://github.com/km-arc/Naravel/releases/tag/v0.2.0 - full history: https://github.com/km-arc/Naravel/blob/main/CHANGELOG.md