- Notifications
You must be signed in to change notification settings - Fork0
Distributed Task Queue (development branch)
License
Niccolum/celery
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Version: | 5.4.0rc1 (opalescent) |
---|---|
Web: | https://docs.celeryq.dev/en/stable/index.html |
Download: | https://pypi.org/project/celery/ |
Source: | https://github.com/celery/celery/ |
Keywords: | task, queue, job, async, rabbitmq, amqp, redis,python, distributed, actors |
This project relies on your generous donations.
If you are using Celery to create a commercial product, please consider becoming ourbacker or oursponsor to ensure Celery's future.
Available as part of the Tidelift Subscription.
The maintainers ofcelery
and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use.Learn more.
Task queues are used as a mechanism to distribute work across threads ormachines.
A task queue's input is a unit of work, called a task, dedicated workerprocesses then constantly monitor the queue for new work to perform.
Celery communicates via messages, usually using a brokerto mediate between clients and workers. To initiate a task a client puts amessage on the queue, the broker then delivers the message to a worker.
A Celery system can consist of multiple workers and brokers, giving wayto high availability and horizontal scaling.
Celery is written in Python, but the protocol can be implemented in anylanguage. In addition to Python there'snode-celery for Node.js,aPHP client,gocelery,gopher-celery for Go, andrusty-celery for Rust.
Language interoperability can also be achieved by using webhooksin such a way that the client enqueues an URL to be requested by a worker.
Celery version 5.3.5 runs on:
- Python (3.8, 3.9, 3.10, 3.11, 3.12)
- PyPy3.9+ (v7.3.12+)
This is the version of celery which will support Python 3.8 or newer.
If you're running an older version of Python, you need to be runningan older version of Celery:
- Python 3.7: Celery 5.2 or earlier.
- Python 3.6: Celery 5.1 or earlier.
- Python 2.7: Celery 4.x series.
- Python 2.6: Celery series 3.1 or earlier.
- Python 2.5: Celery series 3.0 or earlier.
- Python 2.4: Celery series 2.2 or earlier.
Celery is a project with minimal funding,so we don't support Microsoft Windows but it should be working.Please don't open any issues related to that platform.
Celery is usually used with a message broker to send and receive messages.The RabbitMQ, Redis transports are feature complete,but there's also experimental support for a myriad of other solutions, includingusing SQLite for local development.
Celery can run on a single machine, on multiple machines, or evenacross datacenters.
If this is the first time you're trying to use Celery, or you'renew to Celery v5.3.5 coming from previous versions then you should read ourgetting started tutorials:
Tutorial teaching you the bare minimum needed to get started with Celery.
A more complete overview, showing more features.
You can also get started with Celery by using a hosted broker transport CloudAMQP. The largest hosting provider of RabbitMQ is a proud sponsor of Celery.
Simple
Celery is easy to use and maintain, and doesnot need configuration files.
It has an active, friendly community you can talk to for support,like at ourmailing-list, or the IRC channel.
Here's one of the simplest applications you can make:
fromceleryimportCeleryapp=Celery('hello',broker='amqp://guest@localhost//')@app.taskdefhello():return'hello world'
Highly Available
Workers and clients will automatically retry in the eventof connection loss or failure, and some brokers supportHA in way ofPrimary/Primary orPrimary/Replica replication.
Fast
A single Celery process can process millions of tasks a minute,with sub-millisecond round-trip latency (using RabbitMQ,py-librabbitmq, and optimized settings).
Flexible
Almost every part ofCelery can be extended or used on its own,Custom pool implementations, serializers, compression schemes, logging,schedulers, consumers, producers, broker transports, and much more.
Celery is easy to integrate with web frameworks, some of which even haveintegration packages:
Django not needed Pyramid pyramid_celery Pylons celery-pylons Flask not needed web2py web2py-celery Tornado tornado-celery
The integration packages aren't strictly necessary, but they can makedevelopment easier, and sometimes they add important hooks like closingdatabase connections atfork
.
Thelatest documentation is hosted at Read The Docs, containing user guides,tutorials, and an API reference.
最新的中文文档托管在https://www.celerycn.io/ 中,包含用户指南、教程、API接口等。
You can install Celery either via the Python Package Index (PyPI)or from source.
To install usingpip
:
$ pip install -U Celery
Celery also defines a group of bundles that can be usedto install Celery and the dependencies for a given feature.
You can specify these in your requirements or on thepip
command-line by using brackets. Multiple bundles can be specified byseparating them by commas.
$ pip install "celery[redis]"$ pip install "celery[redis,auth,msgpack]"
The following bundles are available:
celery[auth] : | for using theauth security serializer. |
---|---|
celery[msgpack] : | for using the msgpack serializer. |
celery[yaml] : | for using the yaml serializer. |
celery[eventlet] : | for using theeventlet pool. |
---|---|
celery[gevent] : | for using thegevent pool. |
celery[amqp] : | for using the RabbitMQ amqp python library. |
---|---|
celery[redis] : | for using Redis as a message transport or as a result backend. |
celery[sqs] : | for using Amazon SQS as a message transport. |
celery[tblib ]: | for using the |
celery[memcache] : | for using Memcached as a result backend (using |
celery[pymemcache] : | for using Memcached as a result backend (pure-Python implementation). |
celery[cassandra] : | for using Apache Cassandra/Astra DB as a result backend with the DataStax driver. |
celery[azureblockblob] : | for using Azure Storage as a result backend (using |
celery[s3] : | for using S3 Storage as a result backend. |
celery[gcs] : | for using Google Cloud Storage as a result backend. |
celery[couchbase] : | for using Couchbase as a result backend. |
celery[arangodb] : | for using ArangoDB as a result backend. |
celery[elasticsearch] : | for using Elasticsearch as a result backend. |
celery[riak] : | for using Riak as a result backend. |
celery[cosmosdbsql] : | for using Azure Cosmos DB as a result backend (using |
celery[zookeeper] : | for using Zookeeper as a message transport. |
celery[sqlalchemy] : | for using SQLAlchemy as a result backend (supported). |
celery[pyro] : | for using the Pyro4 message transport (experimental). |
celery[slmq] : | for using the SoftLayer Message Queue transport (experimental). |
celery[consul] : | for using the Consul.io Key/Value store as a message transport or result backend (experimental). |
celery[django] : | specifies the lowest version possible for Django support. You should probably not use this in your requirements, it's herefor informational purposes only. |
Download the latest version of Celery from PyPI:
https://pypi.org/project/celery/
You can install it by doing the following:
$ tar xvfz celery-0.0.0.tar.gz$ cd celery-0.0.0$ python setup.py build# python setup.py install
The last command must be executed as a privileged user ifyou aren't currently using a virtualenv.
The Celery development version also requires the developmentversions ofkombu
,amqp
,billiard
, andvine
.
You can install the latest snapshot of these using the followingpip commands:
$ pip install https://github.com/celery/celery/zipball/main#egg=celery$ pip install https://github.com/celery/billiard/zipball/main#egg=billiard$ pip install https://github.com/celery/py-amqp/zipball/main#egg=amqp$ pip install https://github.com/celery/kombu/zipball/main#egg=kombu$ pip install https://github.com/celery/vine/zipball/main#egg=vine
Please see the Contributing section.
For discussions about the usage, development, and future of Celery,please join thecelery-users mailing list.
Come chat with us on IRC. The#celery channel is located at theLibera Chat network.
If you have any suggestions, bug reports, or annoyances please report themto our issue tracker athttps://github.com/celery/celery/issues/
https://github.com/celery/celery/wiki
This project exists thanks to all the people who contribute. Development ofcelery happens at GitHub:https://github.com/celery/celery
You're highly encouraged to participate in the developmentof celery. If you don't like GitHub (for some reason) you're welcometo send regular patches.
Be sure to also read theContributing to Celery section in thedocumentation.
Thank you to all our backers! 🙏 [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with alink to your website. [Become a sponsor]
This software is licensed under the New BSD License. See theLICENSE
file in the top distribution directory for the full license text.