Introducing pybgworker — A Lightweight Python Background Worker Without Redis or RabbitMQ
Source: Dev.to
Overview
pybgworker is an open‑source, lightweight background task worker for Python applications that operates without external services like Redis or RabbitMQ. It uses SQLite as its storage backend, making it ideal for projects that want simple background job processing without additional infrastructure.
Features
- ✅ Background task execution
- ✅ Retries & scheduling
- ✅ Task priorities
- ✅ Graceful worker shutdown
- ✅ Crash recovery
- ✅ Task cancellation
- ✅ Configurable timeouts
- ✅ Rate limiting per task
- ✅ Multiple worker support
- ✅ No external services required
Example Usage
from pybgworker import task
@task(name="tasks.hello")
def hello(name):
print("Hello", name)
hello.delay("World")
Running the Worker
pybgworker run --app tasks
That’s it — background jobs will be processed automatically.
Current Adoption
The package has already surpassed ~600 downloads within the first 5 days, indicating strong interest. Documentation and features are actively being improved.
Contributing
Feedback, suggestions, and contributions from the community are welcome.