Skip to main content

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 SUBSCRIBE channels.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

celery_redis_poll-0.1.3.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

celery_redis_poll-0.1.3-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file celery_redis_poll-0.1.3.tar.gz.

File metadata

  • Download URL: celery_redis_poll-0.1.3.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for celery_redis_poll-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fbaa0015093c0bbbab908bf5fd85bd89aa82c372b07b40cdee6d78e84985227d
MD5 b2c9c59739e3259f5c4a25ffb33ae8f2
BLAKE2b-256 c9d66eda6c0c62194f9476abfa4dd9c37cdff8d647a91f9e8a1f63c07d856fbc

See more details on using hashes here.

File details

Details for the file celery_redis_poll-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for celery_redis_poll-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73113d7522404aea031ffe9e255585caf265b739f643b4414a533f190bdb6f7a
MD5 e3afe8025220c49c0e85f47eab822cc7
BLAKE2b-256 af59e15f4d390a86b5cd4591e88f41c49c16efe1852eba4f295d3bba9cf5eab3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page