Simple .NET in-memory background queue (System.Threading.Channels based).
There are multiple ways to run background tasks in .NET. The most common are:
For the core library:
dotnet add package LocalPost
AWS SQS, Kafka and other integrations are provided as separate packages, like:
dotnet add package LocalPost.SqsConsumer
dotnet add package LocalPost.KafkaConsumer
Before version 8 .NET runtime handled start/stop of the services only synchronously, but now it is possible to enable
concurrent handling of the services. This is done by setting HostOptions
property ConcurrentServiceExecution
to true
:
See for details:
- https://github.com/dotnet/runtime/blob/v8.0.0/src/libraries/Microsoft.Extensions.Hosting/src/Internal/Host.cs
- https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Hosting/src/HostOptions.cs
- Coravel queue — a simple job queue
More complex jobs management / scheduling:
- Hangfire — background job scheduler. Supports advanced scheduling, persistence and jobs distribution across multiple workers.
Service bus (for bigger solutions):