A Redis Backend for Celery with Polling
Project description
Celery Redis Poll Backend
A specialized Redis backend for Celery that replaces the default pub/sub mechanism for task result retrieval with a polling-based approach.
Why Polling Instead of Pub/Sub?
The default Celery Redis backend uses Redis pub/sub for real-time task result notifications. While pub/sub provides immediate updates, it can face challenges in certain scenarios:
- Deadlocks in highly concurrent/multi-threaded workloads due to single-threaded nature of Redis and Celery clients.
- Higher overhead with
SUBSCRIBEchannels.
This backend provides a more robust alternative by using a polling mechanism instead.
Features
- Polling-Based Results: Replaces pub/sub with an efficient polling mechanism for task result retrieval
- Compatible with Existing Code: Drop-in replacement for the standard Redis backend
- Configurable Polling: Adjust polling intervals and timeouts to match your needs
- Resource Efficient: Reduces Redis memory usage by eliminating pub/sub channels
Installation
pip install celery-redis-poll
Usage
Configure your Celery application to use the polling backend:
from celery import Celery
from celery_redis_poll import install_redis_poll_backend
# Registers the polling backend
install_redis_poll_backend()
app = Celery('your_app',
broker='redis://localhost:6379/0',
backend='redispoll://localhost:6379/0')
For clustered Redis, use redisclusterpoll instead of redispoll.
Requirements
- Python >= 3.7
- Celery >= 5.0.0
- Redis >= 4.5.0
- celery-redis-cluster >= 0.1.6
Development
For development, install extra dependencies:
pip install celery-redis-poll[dev]
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file celery_redis_poll-0.1.2.tar.gz.
File metadata
- Download URL: celery_redis_poll-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ff2241b27db6f1bd8ddfc3d1e673592f3be87799157db9d39b44ed2a53fc808
|
|
| MD5 |
0ea2beabb137a0404d3d570b439c2479
|
|
| BLAKE2b-256 |
843317a938713192c327aa2bd43326117b2e0657ba1ccfdcb98f44feb64e4621
|
File details
Details for the file celery_redis_poll-0.1.2-py3-none-any.whl.
File metadata
- Download URL: celery_redis_poll-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
917186666e85b7d0035c9a12576078f055606fcd209b149d1c06114a1955265d
|
|
| MD5 |
4377a68713597a04dc62aaccc2c46770
|
|
| BLAKE2b-256 |
8a6920ceb432173b3f87bac57541a2da4da9ab3de4851a71b4e2bc85feb81320
|