PageRenderTime 42ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/README.rst

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