LiteJobs 1.0.1
dotnet add package LiteJobs --version 1.0.1
NuGet\Install-Package LiteJobs -Version 1.0.1
<PackageReference Include="LiteJobs" Version="1.0.1" />
<PackageVersion Include="LiteJobs" Version="1.0.1" />
<PackageReference Include="LiteJobs" />
paket add LiteJobs --version 1.0.1
#r "nuget: LiteJobs, 1.0.1"
#:package LiteJobs@1.0.1
#addin nuget:?package=LiteJobs&version=1.0.1
#tool nuget:?package=LiteJobs&version=1.0.1
๐ LiteJobs
LiteJobs is a lightweight, database-backed background job processor for .NET โ built for simplicity, zero external dependencies, and easy integration.
No Redis. No RabbitMQ. No complex setup. Just your existing database and a few lines of code.
โจ Why LiteJobs?
- ๐ชถ Lightweight & simple
- ๐๏ธ Uses your existing database (EF Core)
- ๐ Built-in retry mechanism
- โ๏ธ Background worker included
- ๐งฉ Easy integration with DI
- ๐ซ No external infrastructure required
๐ฆ Installation
Install via NuGet:
dotnet add package LiteJobs
โก Getting Started
1๏ธโฃ Register LiteJobs
builder.Services.AddLiteJobs<AppDbContext>();
2๏ธโฃ Register your job service
builder.Services.AddScoped<IMyService, MyService>();
3๏ธโฃ Create a job service
public interface IMyService
{
Task DoWork(int number);
}
public class MyService : IMyService
{
public Task DoWork(int number)
{
Console.WriteLine($"Job executed: {number}");
return Task.CompletedTask;
}
}
4๏ธโฃ Enqueue a job
await _jobClient.Enqueue<IMyService>(x => x.DoWork(99));
5๏ธโฃ Run migrations
dotnet ef migrations add Init
dotnet ef database update
๐ง How It Works
- Job is enqueued via
IJobClient - Job is stored in database
- Background worker polls pending jobs
- Job is executed via reflection
- Status is updated (Pending โ Processing โ Succeeded/Failed)
๐ Job Status Flow
| Status | Description |
|---|---|
| Pending | Waiting to be processed |
| Processing | Currently executing |
| Succeeded | Completed successfully |
| Failed | Failed after retries |
๐ Retry Behavior
LiteJobs automatically retries failed jobs:
- Default retries: 3
- Configurable per job (coming soon)
๐๏ธ Database Schema
LiteJobs creates a table:
LiteJobs
Includes:
- JobType
- Method
- Payload (JSON)
- Status (stored as string)
- Retries
- CreatedAt
๐งช Supported Method Signatures
LiteJobs supports:
DoWork()
DoWork(int id)
DoWork(string name)
DoWork(Guid id)
DoWork(int id, string name, bool flag)
โ ๏ธ Limitations (v1)
- Not distributed (single instance)
- No dashboard UI (yet)
- No delayed/scheduled jobs (yet)
๐ฃ๏ธ Roadmap
- Delayed jobs
- Cron jobs
- Dashboard UI
- Distributed support
- Logging improvements
๐ Documentation
More detailed docs coming soon.
๐ค Contributing
Contributions are welcome!
- Fork the repository
- Create a new branch
- Make your changes
- Submit a PR
๐ฌ Feedback
If you have ideas, suggestions, or issues:
๐ Open an issue on GitHub ๐ Or reach out directly
โค๏ธ Support
If you find LiteJobs useful:
โญ Star the repo ๐ข Share it with others
๐ License
MIT License
๐จโ๐ป Author
Built with โค๏ธ by Salman Tahir
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.