Skip to main content

Redis-Sentinel transport for Celery

Project description

celery-sentinel

Celery broker for Redis Sentinel

Installation

As simple as possible:

pip install celery-sentinel

Usage

Setup celery broker:

#  settings.py

BROKER_URL='redis-sentinel://redis-sentinel:26379/0'

BROKER_TRANSPORT_OPTIONS = {
    'sentinels': [('192.168.1.1', 26379),
                  ('192.168.1.2', 26379),
                  ('192.168.1.3', 26379)],
    'service_name': 'master',
    'socket_timeout': 0.1,
}

Configure celery app:

# celery_app.py
import os

from celery_sentinel import Celery

# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")

app = Celery("your-project")

# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
#   should have a `CELERY_` prefix.
app.config_from_object("django.conf:settings", namespace="CELERY")

# Load task modules from all registered Django app configs.
app.autodiscover_tasks()

Then use the celery as usual.

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-sentinel-0.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

celery_sentinel-0.0.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file celery-sentinel-0.0.1.tar.gz.

File metadata

  • Download URL: celery-sentinel-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

File hashes

Hashes for celery-sentinel-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f3b3d8b8fde874eaeb2a41470d901adf782376402ea58992611d1e60d503bb36
MD5 b5851b90f302469bbaa846b8b9411cf1
BLAKE2b-256 e1e9efc36f9240f7c77fde1cd27f59b53033680071f3390dee29c382614a08a9

See more details on using hashes here.

File details

Details for the file celery_sentinel-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: celery_sentinel-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

File hashes

Hashes for celery_sentinel-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16f2f8fc82997f3685454e9273f241e33406ff53ec94f48632a81b416868b1f0
MD5 7004b30e1b5206551c0cfb0544ad0cdc
BLAKE2b-256 18f8c5423a2bc24dd8a2c15e35eddd3f2689ab9d3b1ce0f40e38410a19e637d4

See more details on using hashes here.

Supported by

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