{ "info": { "author": "Marc Sibson", "author_email": "sibson+redbeat@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Object Brokering", "Topic :: System :: Distributed Computing" ], "description": "RedBeat\n=======\n\n.. image:: https://img.shields.io/pypi/v/celery-redbeat.svg\n :target: https://pypi.python.org/pypi/celery-redbeat\n :alt: PyPI\n\n.. image:: https://img.shields.io/circleci/project/github/sibson/redbeat.svg\n :target: https://circleci.com/gh/sibson/redbeat/\n :alt: Circle CI\n\n`RedBeat `_ is a\n`Celery Beat Scheduler `_\nthat stores the scheduled tasks and runtime metadata in `Redis `_.\n\nWhy RedBeat?\n-------------\n\n#. Dynamic live task creation and modification, without lengthy downtime\n#. Externally manage tasks from any language with Redis bindings\n#. Shared data store; Beat isn't tied to a single drive or machine\n#. Fast startup even with a large task count\n#. Prevent accidentally running multiple Beat servers\n\nGetting Started\n---------------\n\nInstall with pip:\n\n.. code-block:: console\n\n pip install celery-redbeat\n\nConfigure RedBeat settings in your Celery configuration file:\n\n.. code-block:: python\n\n redbeat_redis_url = \"redis://localhost:6379/1\"\n\nThen specify the scheduler when running Celery Beat:\n\n.. code-block:: console\n\n celery beat -S redbeat.RedBeatScheduler\n\nRedBeat uses a distributed lock to prevent multiple instances running.\nTo disable this feature, set:\n\n.. code-block:: python\n\n redbeat_lock_key = None\n\nConfiguration\n--------------\n\nYou can add any of the following parameters to your Celery configuration\n(see Celery 3.x compatible configuration value names in below).\n\n``redbeat_redis_url``\n~~~~~~~~~~~~~~~~~~~~~\n\nURL to redis server used to store the schedule, defaults to value of\n`broker_url`_.\n\n``redbeat_key_prefix``\n~~~~~~~~~~~~~~~~~~~~~~\n\nA prefix for all keys created by RedBeat, defaults to ``'redbeat'``.\n\n``redbeat_lock_key``\n~~~~~~~~~~~~~~~~~~~~\n\nKey used to ensure only a single beat instance runs at a time,\ndefaults to ``':lock'``.\n\n``redbeat_lock_timeout``\n~~~~~~~~~~~~~~~~~~~~~~~~\n\nUnless refreshed the lock will expire after this time, in seconds.\n\nDefaults to five times of the default scheduler's loop interval\n(``300`` seconds), so ``1500`` seconds (``25`` minutes).\n\nSee the `beat_max_loop_interval`_ Celery docs about for more information.\n\n.. _`broker_url`: http://docs.celeryproject.org/en/4.0/userguide/configuration.html#std:setting-broker_url\n.. _`beat_max_loop_interval`: http://docs.celeryproject.org/en/4.0/userguide/configuration.html#std:setting-beat_max_loop_interval\n\nCelery 3.x config names\n~~~~~~~~~~~~~~~~~~~~~~~\n\nHere are the old names of the configuration values for use with\nCelery 3.x.\n\n=================================== ==============================================\n**Celery 4.x** **Celery 3.x**\n=================================== ==============================================\n``redbeat_redis_url`` ``REDBEAT_REDIS_URL``\n``redbeat_key_prefix`` ``REDBEAT_KEY_PREFIX``\n``redbeat_lock_key`` ``REDBEAT_LOCK_KEY``\n``redbeat_lock_timeout`` ``REDBEAT_LOCK_TIMEOUT``\n=================================== ==============================================\n\nDesign\n------\n\nAt its core RedBeat uses a Sorted Set to store the schedule as a priority queue.\nIt stores task details using a hash key with the task definition and metadata.\n\nThe schedule set contains the task keys sorted by the next scheduled run time.\n\nFor each tick of Beat\n\n#. get list of due keys and due next tick\n\n#. retrieve definitions and metadata for all keys from previous step\n\n#. update task metadata and reschedule with next run time of task\n\n#. call due tasks using async_apply\n\n#. calculate time to sleep until start of next tick using remaining tasks\n\nCreating Tasks\n---------------\n\nYou can use Celery's usual way to define static tasks or you can insert tasks\ndirectly into Redis. The config options is called `beat_schedule`_, e.g.:\n\n.. code-block:: python\n\n app.conf.beat_schedule = {\n 'add-every-30-seconds': {\n 'task': 'tasks.add',\n 'schedule': 30.0,\n 'args': (16, 16)\n },\n }\n\nOn Celery 3.x the config option was called `CELERYBEAT_SCHEDULE`_.\n\nThe easiest way to insert tasks from Python is it use ``RedBeatSchedulerEntry()``::\n\n interval = celery.schedules.schedule(run_every=60) # seconds\n entry = RedBeatSchedulerEntry('task-name', 'tasks.some_task', interval, args=['arg1', 2])\n entry.save()\n\nAlternatively, you can insert directly into Redis by creating a new hash with\na key of ``:task-name``. It should contain a single key\n``definition`` which is a JSON blob with the task details.\n\n.. _`CELERYBEAT_SCHEDULE`: http://docs.celeryproject.org/en/3.1/userguide/periodic-tasks.html#beat-entries\n.. _`beat_schedule`: http://docs.celeryproject.org/en/4.0/userguide/periodic-tasks.html#beat-entries\n\nInterval\n~~~~~~~~\nAn interval task is defined with the JSON like::\n\n {\n \"name\" : \"interval example\",\n \"task\" : \"tasks.every_5_seconds\",\n \"schedule\": {\n \"__type__\": \"interval\",\n \"every\" : 5, # seconds\n \"relative\": false, # optional\n },\n \"args\" : [ # optional\n \"param1\",\n \"param2\"\n ],\n \"kwargs\" : { # optional\n \"max_targets\" : 100\n },\n \"enabled\" : true, # optional\n }\n\nCrontab\n~~~~~~~\nAn crontab task is defined with the JSON like::\n\n {\n \"name\" : \"crontab example\",\n \"task\" : \"tasks.daily\",\n \"schedule\": {\n \"__type__\": \"crontab\",\n \"minute\" : \"5\", # optional, defaults to *\n \"hour\" : \"*\", # optional, defaults to *\n \"day_of_week\" : \"monday\", # optional, defaults to *\n \"day_of_month\" : \"*/7\", # optional, defaults to *\n \"month_of_year\" : \"[1-12]\", # optional, defaults to *\n },\n \"args\" : [ # optional\n \"param1\",\n \"param2\"\n ],\n \"kwargs\" : { # optional\n \"max_targets\" : 100\n },\n \"enabled\" : true, # optional\n }\n\n\nScheduling\n~~~~~~~~~~~~\n\nAssuming your `redbeat_key_prefix` config values is set to `'redbeat:'`\n(default) you will also need to insert the new task into the schedule with::\n\n zadd redbeat::schedule 0 new-task-name\n\nThe score is the next time the task should run formatted as a UNIX timestamp.\n\nMetadata\n~~~~~~~~~~~\nApplications may also want to manipulate the task metadata to have more control over when a task runs.\nThe meta key contains a JSON blob as follows::\n\n {\n 'last_run_at': {\n '__type__': 'datetime',\n 'year': 2015,\n 'month': 12,\n 'day': 29,\n 'hour': 16,\n 'minute': 45,\n 'microsecond': 231\n },\n 'total_run_count'; 23\n }\n\nFor instance by default ```last_run_at``` corresponds to when Beat dispatched the task, but depending on queue latency it might not run immediately, but the application could update the metadata with\nthe actual run time, allowing intervals to be relative to last execution rather than last dispatch.\n\nSentinel support\n~~~~~~~~~~~~~~~~\n\nThe redis connexion can use a Redis/Sentinel cluster. The\nconfiguration syntax is inspired from `celery-redis-sentinel\n`_ ::\n\n # celeryconfig.py\n BROKER_URL = 'redis-sentinel://redis-sentinel:26379/0'\n BROKER_TRANSPORT_OPTIONS = {\n 'sentinels': [('192.168.1.1', 26379),\n ('192.168.1.2', 26379),\n ('192.168.1.3', 26379)],\n 'password': '123',\n 'service_name': 'master',\n 'socket_timeout': 0.1,\n }\n\n CELERY_RESULT_BACKEND = 'redis-sentinel://redis-sentinel:26379/1'\n CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS = BROKER_TRANSPORT_OPTIONS\n\nSome notes about the configuration:\n\n* note the use of ``redis-sentinel`` schema within the URL for broker and results\n backend.\n\n* hostname and port are ignored within the actual URL. Sentinel uses transport options\n ``sentinels`` setting to create a ``Sentinel()`` instead of configuration URL.\n\n* ``password`` is going to be used for Celery queue backend as well.\n\nIf other backend is configured for Celery queue use\n``REDBEAT_REDIS_URL`` instead of ``BROKER_URL`` and\n``REDBEAT_REDIS_OPTIONS`` instead of ``BROKER_TRANSPORT_OPTIONS``. to\navoid conflicting options. Here follows the example:::\n\n # celeryconfig.py\n REDBEAT_REDIS_URL = 'redis-sentinel://redis-sentinel:26379/0'\n REDBEAT_REDIS_OPTIONS = {\n 'sentinels': [('192.168.1.1', 26379),\n ('192.168.1.2', 26379),\n ('192.168.1.3', 26379)],\n 'password': '123',\n 'service_name': 'master',\n 'socket_timeout': 0.1,\n 'retry_period': 60,\n }\n\nIf ``retry_period`` is given, retry connection for ``retry_period``\nseconds. If not set, retrying mechanism is not triggered. If set\nto ``-1`` retry infinitely.\n\n\n\nDevelopment\n--------------\nRedBeat is available on `GitHub `_\n\nOnce you have the source you can run the tests with the following commands::\n\n pip install -r requirements.dev.txt\n py.test tests\n\nYou can also quickly fire up a sample Beat instance with::\n\n celery beat --config exampleconf", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sibson/redbeat", "keywords": "python,celery,beat,redis", "license": "Apache License, Version 2.0", "maintainer": "", "maintainer_email": "", "name": "celery-redbeat", "package_url": "https://pypi.org/project/celery-redbeat/", "platform": "", "project_url": "https://pypi.org/project/celery-redbeat/", "project_urls": { "Homepage": "https://github.com/sibson/redbeat" }, "release_url": "https://pypi.org/project/celery-redbeat/0.13.0/", "requires_dist": null, "requires_python": "", "summary": "A Celery Beat Scheduler using Redis for persistent storage", "version": "0.13.0" }, "last_serial": 5147456, "releases": { "0.10.0": [ { "comment_text": "", "digests": { "md5": "7479aaaea380669c9fb5830a6783ada9", "sha256": "0ac7e6fbf09b91e03a4b2f92474a82bacf256f0f82e0c29f147358a91b26c472" }, "downloads": -1, "filename": "celery-redbeat-0.10.0.tar.gz", "has_sig": false, "md5_digest": "7479aaaea380669c9fb5830a6783ada9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13125, "upload_time": "2017-05-11T04:47:48", "url": "https://files.pythonhosted.org/packages/66/f5/e3cdfa06d7f515d6badf486158b8a0f67318fb580a750655db7dc9c0c7af/celery-redbeat-0.10.0.tar.gz" } ], "0.10.0rc1": [ { "comment_text": "", "digests": { "md5": "cbba3bed5860d2f3183977beebc29f79", "sha256": "8c84687742379d795d4ab00a75fc4bfe73f77546aeb7fc183c33ce94b0fa4173" }, "downloads": -1, "filename": "celery-redbeat-0.10.0rc1.tar.gz", "has_sig": false, "md5_digest": "cbba3bed5860d2f3183977beebc29f79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11523, "upload_time": "2017-02-16T06:42:00", "url": "https://files.pythonhosted.org/packages/e6/9d/c6a1280a24883107fd45f3fb7f35dfe724d0852da395248f536d71321e79/celery-redbeat-0.10.0rc1.tar.gz" } ], "0.10.4": [ { "comment_text": "", "digests": { "md5": "a11cd768deed68d56d5a419175b1d7f1", "sha256": "26a5ae36cd53c6e610fbeab4d2fbc7ded6432ee77358b5530f187eac3436f046" }, "downloads": -1, "filename": "celery-redbeat-0.10.4.tar.gz", "has_sig": false, "md5_digest": "a11cd768deed68d56d5a419175b1d7f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13177, "upload_time": "2017-10-05T16:30:54", "url": "https://files.pythonhosted.org/packages/a5/00/d253e3e12c776b54cf35fbbce0f71cb509f57cfb56ecf8c1e2fd264a8063/celery-redbeat-0.10.4.tar.gz" } ], "0.11.0": [ { "comment_text": "", "digests": { "md5": "5abc64b05713efb1a9bd689838a3e7cc", "sha256": "1adde1b7dc285afc9d8a3f9b19634bb3b27fff3c2ee4cd985338b60ab6bcaffc" }, "downloads": -1, "filename": "celery-redbeat-0.11.0.tar.gz", "has_sig": false, "md5_digest": "5abc64b05713efb1a9bd689838a3e7cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15339, "upload_time": "2017-10-18T20:29:56", "url": "https://files.pythonhosted.org/packages/7a/96/d8024002b7d2fe453cbb51ebf708978c59cde15a2346640b9530e1a539ff/celery-redbeat-0.11.0.tar.gz" } ], "0.11.1": [ { "comment_text": "", "digests": { "md5": "17b21ab4ed6571618dc7fac0c5a41350", "sha256": "fa1951cee7dfb8e185f53ce6dfb78f53b66ace76d5799f67ddac75ae1550aa87" }, "downloads": -1, "filename": "celery-redbeat-0.11.1.tar.gz", "has_sig": false, "md5_digest": "17b21ab4ed6571618dc7fac0c5a41350", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15571, "upload_time": "2018-01-03T19:24:36", "url": "https://files.pythonhosted.org/packages/b2/b9/e50bc589a700c29cd0b7455117fdf7ac03049783345664fc2da4926e81d5/celery-redbeat-0.11.1.tar.gz" } ], "0.12.0": [ { "comment_text": "", "digests": { "md5": "130d1ae38387d65cede7951640860ff3", "sha256": "94b2a227828af143a54d338b46bde6315641940d818d15c9f9f2134668a9fade" }, "downloads": -1, "filename": "celery-redbeat-0.12.0.tar.gz", "has_sig": false, "md5_digest": "130d1ae38387d65cede7951640860ff3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17654, "upload_time": "2018-12-06T18:33:39", "url": "https://files.pythonhosted.org/packages/e4/a9/93a3b9e5ffed748f9b54d960174d937ab2c767bf342d4549d67ba4767cf2/celery-redbeat-0.12.0.tar.gz" } ], "0.13.0": [ { "comment_text": "", "digests": { "md5": "fee669b79632539bd54d98b59b52c965", "sha256": "8ba060f5fffa96fc6dbb0e37a10506cada03333f34ba502b134cbbdb08891266" }, "downloads": -1, "filename": "celery-redbeat-0.13.0.tar.gz", "has_sig": false, "md5_digest": "fee669b79632539bd54d98b59b52c965", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17302, "upload_time": "2019-04-16T00:40:10", "url": "https://files.pythonhosted.org/packages/43/dc/b2dff764e1a9f956e25880635cf1042602d430184b4727c3773764d66d80/celery-redbeat-0.13.0.tar.gz" } ], "0.8.0": [], "0.9.2": [ { "comment_text": "", "digests": { "md5": "33b5178d3ab9bff3b343de4872b7563e", "sha256": "0298a752086f02e97b1f4e72cb2fe202e25bf6fcb8b3d8e9300c319ac70ea9dd" }, "downloads": -1, "filename": "celery-redbeat-0.9.2.tar.gz", "has_sig": false, "md5_digest": "33b5178d3ab9bff3b343de4872b7563e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10660, "upload_time": "2016-04-21T07:14:41", "url": "https://files.pythonhosted.org/packages/35/b9/32c6fc2471886d3a4d6e2b5330bb7ebd622cf2b7003fdb27365b38e58a70/celery-redbeat-0.9.2.tar.gz" } ], "0.9.3": [ { "comment_text": "", "digests": { "md5": "1fcd487580208566d96e5a9da4ab6b4a", "sha256": "5cba25c730f90f1bccd481b08a9bf09b262fd62cd440bc42025b24f4a086ef02" }, "downloads": -1, "filename": "celery-redbeat-0.9.3.tar.gz", "has_sig": false, "md5_digest": "1fcd487580208566d96e5a9da4ab6b4a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10975, "upload_time": "2017-02-16T06:30:41", "url": "https://files.pythonhosted.org/packages/71/e6/e4932f69aa8ca9128aa1167df1e8bf515ab043f0613727195a56821343a4/celery-redbeat-0.9.3.tar.gz" } ], "0.9.3rc1": [ { "comment_text": "", "digests": { "md5": "cfd54526eba8dfcf86005c9b20dfea78", "sha256": "5ae2a6abb3b1586e29b0ae5e8f84f5ef53fbee8b41ba1360c79a83102991dab8" }, "downloads": -1, "filename": "celery-redbeat-0.9.3rc1.tar.gz", "has_sig": false, "md5_digest": "cfd54526eba8dfcf86005c9b20dfea78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10648, "upload_time": "2016-05-05T17:20:39", "url": "https://files.pythonhosted.org/packages/8b/8f/73a6dd674894fafa84b808e14a61aa6987f736fe0b5edab11c2f0920df72/celery-redbeat-0.9.3rc1.tar.gz" } ], "0.9.3rc3": [ { "comment_text": "", "digests": { "md5": "130b263b86f3ac23b36bf56a9009ab48", "sha256": "dd57fe1c67a6e0616afb322304b199d0a73bd1de918103e48204296335b31410" }, "downloads": -1, "filename": "celery-redbeat-0.9.3rc3.tar.gz", "has_sig": false, "md5_digest": "130b263b86f3ac23b36bf56a9009ab48", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10730, "upload_time": "2016-06-02T18:38:38", "url": "https://files.pythonhosted.org/packages/25/33/76f51df40f52a62ac34e1e021640484168868fe33bc7ad394429a8f40e78/celery-redbeat-0.9.3rc3.tar.gz" } ], "0.9.3rc4": [ { "comment_text": "", "digests": { "md5": "582f0739f1a1f49a7338834c22bb6978", "sha256": "f814a4b64fd63e71cf2f9b414b73b63f26003a0d171f1b489668840573cb78a7" }, "downloads": -1, "filename": "celery-redbeat-0.9.3rc4.tar.gz", "has_sig": false, "md5_digest": "582f0739f1a1f49a7338834c22bb6978", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10777, "upload_time": "2016-08-12T19:32:54", "url": "https://files.pythonhosted.org/packages/3c/61/719c126b0bab9609685aeacb1c70d5d250ad8b3d714796ebf7fd7939c285/celery-redbeat-0.9.3rc4.tar.gz" } ], "0.9.3rc5": [ { "comment_text": "", "digests": { "md5": "d00a3469ce404c9dc43e9dbdd78a0a1d", "sha256": "6c58108e0624c85e1401ebb0af9b6f041af3c00834ab0fd753d2ca0ea4cc39bc" }, "downloads": -1, "filename": "celery-redbeat-0.9.3rc5.tar.gz", "has_sig": false, "md5_digest": "d00a3469ce404c9dc43e9dbdd78a0a1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10937, "upload_time": "2016-08-30T20:00:11", "url": "https://files.pythonhosted.org/packages/4c/45/0141a694bc83437b02fe04811f9440a7ae8642e2bbb17fc33b12d2d02f42/celery-redbeat-0.9.3rc5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fee669b79632539bd54d98b59b52c965", "sha256": "8ba060f5fffa96fc6dbb0e37a10506cada03333f34ba502b134cbbdb08891266" }, "downloads": -1, "filename": "celery-redbeat-0.13.0.tar.gz", "has_sig": false, "md5_digest": "fee669b79632539bd54d98b59b52c965", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17302, "upload_time": "2019-04-16T00:40:10", "url": "https://files.pythonhosted.org/packages/43/dc/b2dff764e1a9f956e25880635cf1042602d430184b4727c3773764d66d80/celery-redbeat-0.13.0.tar.gz" } ] }