README.rst 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. =================================
  2. celery - Distributed Task Queue
  3. =================================
  4. .. image:: http://cloud.github.com/downloads/celery/celery/celery_128.png
  5. :Version: 3.0.0 (Chiastic Slide)
  6. :Web: http://celeryproject.org/
  7. :Download: http://pypi.python.org/pypi/celery/
  8. :Source: http://github.com/celery/celery/
  9. :Keywords: task queue, job queue, asynchronous, rabbitmq, amqp, redis,
  10. python, webhooks, queue, distributed
  11. --
  12. .. contents::
  13. :local:
  14. :depth: 1
  15. What is a Task Queue?
  16. =====================
  17. Task queues are used as a mechanism to distribute work across threads or
  18. machines.
  19. A task queue's input is a unit of work, called a task, dedicated worker
  20. processes then constantly monitor the queue for new work to perform.
  21. Celery communicates via messages using a broker
  22. to mediate between clients and workers. To initiate a task a client puts a
  23. message on the queue, the broker then delivers the message to a worker.
  24. A Celery system can consist of multiple workers and brokers, giving way
  25. to high availability and horizontal scaling.
  26. Celery is written in Python, but the protocol can be implemented in any
  27. language. So far there's RCelery_ for the Ruby programming language, and a
  28. `PHP client`, but language interoperability can also be achieved
  29. by using webhooks.
  30. .. _RCelery: http://leapfrogdevelopment.github.com/rcelery/
  31. .. _`PHP client`: https://github.com/gjedeer/celery-php
  32. .. _`using webhooks`:
  33. http://celery.github.com/celery/userguide/remote-tasks.html
  34. What do I need?
  35. ===============
  36. Celery version 3.0 runs on,
  37. - Python ❨2.5, 2.6, 2.7, 3.2, 3.3❩
  38. - PyPy ❨1.8, 1.9❩
  39. - Jython ❨2.5, 2.7❩.
  40. This is the last version to support Python 2.5,
  41. and from Celery 3.1, Python 2.6 or later is required.
  42. The last version to support Python 2.4 was Celery series 2.2.
  43. *Celery* requires a message broker to send and receive messages.
  44. The RabbitMQ, Redis and MongoDB broker transports are feature complete,
  45. but there's also support for a myriad of other solutions, including
  46. using SQLite for local development.
  47. *Celery* can run on a single machine, on multiple machines, or even
  48. across datacenters.
  49. Get Started
  50. ===========
  51. If this is the first time you're trying to use Celery, or you are
  52. new to Celery 3.0 coming from previous versions then you should read our
  53. getting started tutorials:
  54. - `First steps with Celery`_
  55. Tutorial teaching you the bare minimum needed to get started with Celery.
  56. - `Next steps`_
  57. A more complete overview, showing more features.
  58. .. _`First steps with Celery`:
  59. http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html
  60. .. _`Next steps`:
  61. http://docs.celeryproject.org/en/latest/getting-started/next-steps.html
  62. Celery is…
  63. ==========
  64. - **Simple**
  65. Celery is easy to use and maintain, and does *not need configuration files*.
  66. It has an active, friendly community you can talk to for support,
  67. including a `mailing-list`_ and and an IRC channel.
  68. Here's one of the simplest applications you can make::
  69. from celery import Celery
  70. celery = Celery('hello', broker='amqp://guest@localhost//')
  71. @celery.task()
  72. def hello():
  73. return 'hello world'
  74. - **Highly Available**
  75. Workers and clients will automatically retry in the event
  76. of connection loss or failure, and some brokers support
  77. HA in way of *Master/Master* or *Master/Slave* replication.
  78. - **Fast**
  79. A single Celery process can process millions of tasks a minute,
  80. with sub-millisecond round-trip latency (using RabbitMQ,
  81. py-librabbitmq, and optimized settings).
  82. - **Flexible**
  83. Almost every part of *Celery* can be extended or used on its own,
  84. Custom pool implementations, serializers, compression schemes, logging,
  85. schedulers, consumers, producers, autoscalers, broker transports and much more.
  86. It supports...
  87. ==============
  88. - **Brokers**
  89. - RabbitMQ_, Redis_,
  90. - MongoDB_, Beanstalk_,
  91. - CouchDB_, SQLAlchemy_,
  92. - Django ORM, Amazon SQS,
  93. - and more…
  94. - **Concurrency**
  95. - multiprocessing, Eventlet_, gevent_, threads/single threaded
  96. - **Result Stores**
  97. - AMQP, Redis
  98. - memcached, MongoDB
  99. - SQLAlchemy, Django ORM
  100. - Apache Cassandra
  101. - **Serialization**
  102. - *pickle*, *json*, *yaml*, *msgpack*.
  103. - *zlib*, *bzip2* compression.
  104. - Cryptographic message signing.
  105. .. _`Eventlet`: http://eventlet.net/
  106. .. _`gevent`: http://gevent.org/
  107. .. _RabbitMQ: http://rabbitmq.com
  108. .. _Redis: http://redis.io
  109. .. _MongoDB: http://mongodb.org
  110. .. _Beanstalk: http://kr.github.com/beanstalkd
  111. .. _CouchDB: http://couchdb.apache.org
  112. .. _SQLAlchemy: http://sqlalchemy.org
  113. Framework Integration
  114. =====================
  115. Celery is easy to integrate with web frameworks, some of which even have
  116. integration packages:
  117. +--------------------+------------------------+
  118. | `Django`_ | `django-celery`_ |
  119. +--------------------+------------------------+
  120. | `Pyramid`_ | `pyramid_celery`_ |
  121. +--------------------+------------------------+
  122. | `Pylons`_ | `celery-pylons`_ |
  123. +--------------------+------------------------+
  124. | `Flask`_ | not needed |
  125. +--------------------+------------------------+
  126. | `web2py`_ | `web2py-celery`_ |
  127. +--------------------+------------------------+
  128. | `Tornado`_ | `tornado-celery`_ |
  129. +--------------------+------------------------+
  130. The integration packages are not strictly necessary, but they can make
  131. development easier, and sometimes they add important hooks like closing
  132. database connections at ``fork``.
  133. .. _`Django`: http://djangoproject.com/
  134. .. _`Pylons`: http://pylonshq.com/
  135. .. _`Flask`: http://flask.pocoo.org/
  136. .. _`web2py`: http://web2py.com/
  137. .. _`Bottle`: http://bottlepy.org/
  138. .. _`Pyramid`: http://docs.pylonsproject.org/en/latest/docs/pyramid.html
  139. .. _`pyramid_celery`: http://pypi.python.org/pypi/pyramid_celery/
  140. .. _`django-celery`: http://pypi.python.org/pypi/django-celery
  141. .. _`celery-pylons`: http://pypi.python.org/pypi/celery-pylons
  142. .. _`web2py-celery`: http://code.google.com/p/web2py-celery/
  143. .. _`Tornado`: http://www.tornadoweb.org/
  144. .. _`tornado-celery`: http://github.com/mher/tornado-celery/
  145. .. _celery-documentation:
  146. Documentation
  147. =============
  148. The `latest documentation`_ with user guides, tutorials and API reference
  149. is hosted at Read The Docs.
  150. .. _`latest documentation`: http://docs.celeryproject.org/en/latest/
  151. .. _celery-installation:
  152. Installation
  153. ============
  154. You can install Celery either via the Python Package Index (PyPI)
  155. or from source.
  156. To install using `pip`,::
  157. $ pip install -U Celery
  158. To install using `easy_install`,::
  159. $ easy_install -U Celery
  160. .. _bundles:
  161. Bundles
  162. -------
  163. Celery also defines a group of bundles that can be used
  164. to install Celery and the dependencies for a given feature.
  165. The following bundles are available:
  166. :`celery-with-redis`_:
  167. for using Redis as a broker.
  168. :`celery-with-mongodb`_:
  169. for using MongoDB as a broker.
  170. :`django-celery-with-redis`_:
  171. for Django, and using Redis as a broker.
  172. :`django-celery-with-mongodb`_:
  173. for Django, and using MongoDB as a broker.
  174. .. _`celery-with-redis`:
  175. http://pypi.python.org/pypi/celery-with-redis/
  176. .. _`celery-with-mongodb`:
  177. http://pypi.python.org/pypi/celery-with-mongdb/
  178. .. _`django-celery-with-redis`:
  179. http://pypi.python.org/pypi/django-celery-with-redis/
  180. .. _`django-celery-with-mongodb`:
  181. http://pypi.python.org/pypi/django-celery-with-mongdb/
  182. .. _celery-installing-from-source:
  183. Downloading and installing from source
  184. --------------------------------------
  185. Download the latest version of Celery from
  186. http://pypi.python.org/pypi/celery/
  187. You can install it by doing the following,::
  188. $ tar xvfz celery-0.0.0.tar.gz
  189. $ cd celery-0.0.0
  190. $ python setup.py build
  191. # python setup.py install
  192. The last command must be executed as a privileged user if
  193. you are not currently using a virtualenv.
  194. .. _celery-installing-from-git:
  195. Using the development version
  196. -----------------------------
  197. You can clone the repository by doing the following::
  198. $ git clone https://github.com/celery/celery
  199. $ cd celery
  200. $ python setup.py develop
  201. The development version will usually also depend on the development
  202. version of `kombu`_, the messaging framework Celery uses
  203. to send and receive messages, so you should also install that from git::
  204. $ git clone https://github.com/celery/kombu
  205. $ cd kombu
  206. $ python setup.py develop
  207. .. _`kombu`: http://kombu.readthedocs.org/en/latest/
  208. .. _getting-help:
  209. Getting Help
  210. ============
  211. .. _mailing-list:
  212. Mailing list
  213. ------------
  214. For discussions about the usage, development, and future of celery,
  215. please join the `celery-users`_ mailing list.
  216. .. _`celery-users`: http://groups.google.com/group/celery-users/
  217. .. _irc-channel:
  218. IRC
  219. ---
  220. Come chat with us on IRC. The **#celery** channel is located at the `Freenode`_
  221. network.
  222. .. _`Freenode`: http://freenode.net
  223. .. _bug-tracker:
  224. Bug tracker
  225. ===========
  226. If you have any suggestions, bug reports or annoyances please report them
  227. to our issue tracker at http://github.com/celery/celery/issues/
  228. .. _wiki:
  229. Wiki
  230. ====
  231. http://wiki.github.com/celery/celery/
  232. .. _contributing-short:
  233. Contributing
  234. ============
  235. Development of `celery` happens at Github: http://github.com/celery/celery
  236. You are highly encouraged to participate in the development
  237. of `celery`. If you don't like Github (for some reason) you're welcome
  238. to send regular patches.
  239. Be sure to also read the `Contributing to Celery`_ section in the
  240. documentation.
  241. .. _`Contributing to Celery`: http://celery.github.com/celery/contributing.html
  242. .. _license:
  243. License
  244. =======
  245. This software is licensed under the `New BSD License`. See the ``LICENSE``
  246. file in the top distribution directory for the full license text.
  247. .. # vim: syntax=rst expandtab tabstop=4 shiftwidth=4 shiftround