next-steps.rst 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. .. _next-steps:
  2. ============
  3. Next Steps
  4. ============
  5. The :ref:`first-steps` guide is intentionally minimal. In this guide
  6. I'll demonstrate what Celery offers in more detail, including
  7. how to add Celery support for your application and library.
  8. This document doesn't document all of Celery's features and
  9. best practices, so it's recommended that you also read the
  10. :ref:`User Guide <guide>`
  11. .. contents::
  12. :local:
  13. :depth: 1
  14. Using Celery in your Application
  15. ================================
  16. .. _project-layout:
  17. Our Project
  18. -----------
  19. Project layout::
  20. proj/__init__.py
  21. /celery.py
  22. /tasks.py
  23. :file:`proj/celery.py`
  24. ~~~~~~~~~~~~~~~~~~~~~~
  25. .. literalinclude:: ../../examples/next-steps/proj/celery.py
  26. :language: python
  27. In this module you created our :class:`@Celery` instance (sometimes
  28. referred to as the *app*). To use Celery within your project
  29. you simply import this instance.
  30. - The ``broker`` argument specifies the URL of the broker to use.
  31. See :ref:`celerytut-broker` for more information.
  32. - The ``backend`` argument specifies the result backend to use,
  33. It's used to keep track of task state and results.
  34. While results are disabled by default I use the RPC result backend here
  35. because I demonstrate how retrieving results work later, you may want to use
  36. a different backend for your application. They all have different
  37. strengths and weaknesses. If you don't need results it's better
  38. to disable them. Results can also be disabled for individual tasks
  39. by setting the ``@task(ignore_result=True)`` option.
  40. See :ref:`celerytut-keeping-results` for more information.
  41. - The ``include`` argument is a list of modules to import when
  42. the worker starts. You need to add our tasks module here so
  43. that the worker is able to find our tasks.
  44. :file:`proj/tasks.py`
  45. ~~~~~~~~~~~~~~~~~~~~~
  46. .. literalinclude:: ../../examples/next-steps/proj/tasks.py
  47. :language: python
  48. Starting the worker
  49. -------------------
  50. The :program:`celery` program can be used to start the worker (you need to run the worker in the directory above proj):
  51. .. code-block:: console
  52. $ celery -A proj worker -l info
  53. When the worker starts you should see a banner and some messages::
  54. -------------- celery@halcyon.local v4.0 (latentcall)
  55. ---- **** -----
  56. --- * *** * -- [Configuration]
  57. -- * - **** --- . broker: amqp://guest@localhost:5672//
  58. - ** ---------- . app: __main__:0x1012d8590
  59. - ** ---------- . concurrency: 8 (processes)
  60. - ** ---------- . events: OFF (enable -E to monitor this worker)
  61. - ** ----------
  62. - *** --- * --- [Queues]
  63. -- ******* ---- . celery: exchange:celery(direct) binding:celery
  64. --- ***** -----
  65. [2012-06-08 16:23:51,078: WARNING/MainProcess] celery@halcyon.local has started.
  66. -- The *broker* is the URL you specified in the broker argument in our ``celery``
  67. module, you can also specify a different broker on the command-line by using
  68. the :option:`-b <celery -b>` option.
  69. -- *Concurrency* is the number of prefork worker process used
  70. to process your tasks concurrently, when all of these are busy doing work
  71. new tasks will have to wait for one of the tasks to finish before
  72. it can be processed.
  73. The default concurrency number is the number of CPU's on that machine
  74. (including cores), you can specify a custom number using
  75. the :option:`celery worker -c` option.
  76. There's no recommended value, as the optimal number depends on a number of
  77. factors, but if your tasks are mostly I/O-bound then you can try to increase
  78. it, experimentation has shown that adding more than twice the number
  79. of CPU's is rarely effective, and likely to degrade performance
  80. instead.
  81. Including the default prefork pool, Celery also supports using
  82. Eventlet, Gevent, and running in a single thread (see :ref:`concurrency`).
  83. -- *Events* is an option that when enabled causes Celery to send
  84. monitoring messages (events) for actions occurring in the worker.
  85. These can be used by monitor programs like ``celery events``,
  86. and Flower - the real-time Celery monitor, that you can read about in
  87. the :ref:`Monitoring and Management guide <guide-monitoring>`.
  88. -- *Queues* is the list of queues that the worker will consume
  89. tasks from. The worker can be told to consume from several queues
  90. at once, and this is used to route messages to specific workers
  91. as a means for Quality of Service, separation of concerns,
  92. and prioritization, all described in the :ref:`Routing Guide
  93. <guide-routing>`.
  94. You can get a complete list of command-line arguments
  95. by passing in the :option:`--help <celery --help>` flag:
  96. .. code-block:: console
  97. $ celery worker --help
  98. These options are described in more detailed in the :ref:`Workers Guide <guide-workers>`.
  99. Stopping the worker
  100. ~~~~~~~~~~~~~~~~~~~
  101. To stop the worker simply hit :kbd:`Control-c`. A list of signals supported
  102. by the worker is detailed in the :ref:`Workers Guide <guide-workers>`.
  103. In the background
  104. ~~~~~~~~~~~~~~~~~
  105. In production you'll want to run the worker in the background, this is
  106. described in detail in the :ref:`daemonization tutorial <daemonizing>`.
  107. The daemonization scripts uses the :program:`celery multi` command to
  108. start one or more workers in the background:
  109. .. code-block:: console
  110. $ celery multi start w1 -A proj -l info
  111. celery multi v4.0.0 (latentcall)
  112. > Starting nodes...
  113. > w1.halcyon.local: OK
  114. You can restart it too:
  115. .. code-block:: console
  116. $ celery multi restart w1 -A proj -l info
  117. celery multi v4.0.0 (latentcall)
  118. > Stopping nodes...
  119. > w1.halcyon.local: TERM -> 64024
  120. > Waiting for 1 node.....
  121. > w1.halcyon.local: OK
  122. > Restarting node w1.halcyon.local: OK
  123. celery multi v4.0.0 (latentcall)
  124. > Stopping nodes...
  125. > w1.halcyon.local: TERM -> 64052
  126. or stop it:
  127. .. code-block:: console
  128. $ celery multi stop w1 -A proj -l info
  129. The ``stop`` command is asynchronous so it won't wait for the
  130. worker to shutdown. You'll probably want to use the ``stopwait`` command
  131. instead, this ensures all currently executing tasks are completed
  132. before exiting:
  133. .. code-block:: console
  134. $ celery multi stopwait w1 -A proj -l info
  135. .. note::
  136. :program:`celery multi` doesn't store information about workers
  137. so you need to use the same command-line arguments when
  138. restarting. Only the same pidfile and logfile arguments must be
  139. used when stopping.
  140. By default it'll create pid and log files in the current directory,
  141. to protect against multiple workers launching on top of each other
  142. you're encouraged to put these in a dedicated directory:
  143. .. code-block:: console
  144. $ mkdir -p /var/run/celery
  145. $ mkdir -p /var/log/celery
  146. $ celery multi start w1 -A proj -l info --pidfile=/var/run/celery/%n.pid \
  147. --logfile=/var/log/celery/%n%I.log
  148. With the multi command you can start multiple workers, and there's a powerful
  149. command-line syntax to specify arguments for different workers too,
  150. for example:
  151. .. code-block:: console
  152. $ celery multi start 10 -A proj -l info -Q:1-3 images,video -Q:4,5 data \
  153. -Q default -L:4,5 debug
  154. For more examples see the :mod:`~celery.bin.multi` module in the API
  155. reference.
  156. .. _app-argument:
  157. About the :option:`--app <celery --app>` argument
  158. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  159. The :option:`--app <celery --app>` argument specifies the Celery app instance
  160. to use, it must be in the form of ``module.path:attribute``
  161. But it also supports a shortcut form If only a package name is specified,
  162. where it'll try to search for the app instance, in the following order:
  163. With :option:`--app=proj <celery --app>`:
  164. 1) an attribute named ``proj.app``, or
  165. 2) an attribute named ``proj.celery``, or
  166. 3) any attribute in the module ``proj`` where the value is a Celery
  167. application, or
  168. If none of these are found it'll try a submodule named ``proj.celery``:
  169. 4) an attribute named ``proj.celery.app``, or
  170. 5) an attribute named ``proj.celery.celery``, or
  171. 6) Any attribute in the module ``proj.celery`` where the value is a Celery
  172. application.
  173. This scheme mimics the practices used in the documentation -- that is,
  174. ``proj:app`` for a single contained module, and ``proj.celery:app``
  175. for larger projects.
  176. .. _calling-tasks:
  177. Calling Tasks
  178. =============
  179. You can call a task using the :meth:`delay` method:
  180. .. code-block:: pycon
  181. >>> add.delay(2, 2)
  182. This method is actually a star-argument shortcut to another method called
  183. :meth:`apply_async`:
  184. .. code-block:: pycon
  185. >>> add.apply_async((2, 2))
  186. The latter enables you to specify execution options like the time to run
  187. (countdown), the queue it should be sent to, and so on:
  188. .. code-block:: pycon
  189. >>> add.apply_async((2, 2), queue='lopri', countdown=10)
  190. In the above example the task will be sent to a queue named ``lopri`` and the
  191. task will execute, at the earliest, 10 seconds after the message was sent.
  192. Applying the task directly will execute the task in the current process,
  193. so that no message is sent:
  194. .. code-block:: pycon
  195. >>> add(2, 2)
  196. 4
  197. These three methods - :meth:`delay`, :meth:`apply_async`, and applying
  198. (``__call__``), represents the Celery calling API, that's also used for
  199. signatures.
  200. A more detailed overview of the Calling API can be found in the
  201. :ref:`Calling User Guide <guide-calling>`.
  202. Every task invocation will be given a unique identifier (an UUID), this
  203. is the task id.
  204. The ``delay`` and ``apply_async`` methods return an :class:`~@AsyncResult`
  205. instance, that can be used to keep track of the tasks execution state.
  206. But for this you need to enable a :ref:`result backend <task-result-backends>` so that
  207. the state can be stored somewhere.
  208. Results are disabled by default because of the fact that there's no result
  209. backend that suits every application, so to choose one you need to consider
  210. the drawbacks of each individual backend. For many tasks
  211. keeping the return value isn't even very useful, so it's a sensible default to
  212. have. Also note that result backends aren't used for monitoring tasks and workers,
  213. for that Celery uses dedicated event messages (see :ref:`guide-monitoring`).
  214. If you have a result backend configured you can retrieve the return
  215. value of a task:
  216. .. code-block:: pycon
  217. >>> res = add.delay(2, 2)
  218. >>> res.get(timeout=1)
  219. 4
  220. You can find the task's id by looking at the :attr:`id` attribute:
  221. .. code-block:: pycon
  222. >>> res.id
  223. d6b3aea2-fb9b-4ebc-8da4-848818db9114
  224. You can also inspect the exception and traceback if the task raised an
  225. exception, in fact ``result.get()`` will propagate any errors by default:
  226. .. code-block:: pycon
  227. >>> res = add.delay(2)
  228. >>> res.get(timeout=1)
  229. .. code-block:: pytb
  230. Traceback (most recent call last):
  231. File "<stdin>", line 1, in <module>
  232. File "/opt/devel/celery/celery/result.py", line 113, in get
  233. interval=interval)
  234. File "/opt/devel/celery/celery/backends/rpc.py", line 138, in wait_for
  235. raise meta['result']
  236. TypeError: add() takes exactly 2 arguments (1 given)
  237. If you don't wish for the errors to propagate then you can disable that
  238. by passing the ``propagate`` argument:
  239. .. code-block:: pycon
  240. >>> res.get(propagate=False)
  241. TypeError('add() takes exactly 2 arguments (1 given)',)
  242. In this case it'll return the exception instance raised instead,
  243. and so to check whether the task succeeded or failed you'll have to
  244. use the corresponding methods on the result instance:
  245. .. code-block:: pycon
  246. >>> res.failed()
  247. True
  248. >>> res.successful()
  249. False
  250. So how does it know if the task has failed or not? It can find out by looking
  251. at the tasks *state*:
  252. .. code-block:: pycon
  253. >>> res.state
  254. 'FAILURE'
  255. A task can only be in a single state, but it can progress through several
  256. states. The stages of a typical task can be::
  257. PENDING -> STARTED -> SUCCESS
  258. The started state is a special state that's only recorded if the
  259. :setting:`task_track_started` setting is enabled, or if the
  260. ``@task(track_started=True)`` option is set for the task.
  261. The pending state is actually not a recorded state, but rather
  262. the default state for any task id that's unknown: this you can see
  263. from this example:
  264. .. code-block:: pycon
  265. >>> from proj.celery import app
  266. >>> res = app.AsyncResult('this-id-does-not-exist')
  267. >>> res.state
  268. 'PENDING'
  269. If the task is retried the stages can become even more complex.
  270. To demonstrate, for a task that's retried two times the stages would be:
  271. .. code-block:: text
  272. PENDING -> STARTED -> RETRY -> STARTED -> RETRY -> STARTED -> SUCCESS
  273. To read more about task states you should see the :ref:`task-states` section
  274. in the tasks user guide.
  275. Calling tasks is described in detail in the
  276. :ref:`Calling Guide <guide-calling>`.
  277. .. _designing-workflows:
  278. *Canvas*: Designing Work-flows
  279. ==============================
  280. You just learned how to call a task using the tasks ``delay`` method,
  281. and this is often all you need, but sometimes you may want to pass the
  282. signature of a task invocation to another process or as an argument to another
  283. function, for this Celery uses something called *signatures*.
  284. A signature wraps the arguments and execution options of a single task
  285. invocation in a way such that it can be passed to functions or even serialized
  286. and sent across the wire.
  287. You can create a signature for the ``add`` task using the arguments ``(2, 2)``,
  288. and a countdown of 10 seconds like this:
  289. .. code-block:: pycon
  290. >>> add.signature((2, 2), countdown=10)
  291. tasks.add(2, 2)
  292. There's also a shortcut using star arguments:
  293. .. code-block:: pycon
  294. >>> add.s(2, 2)
  295. tasks.add(2, 2)
  296. And there's that calling API again…
  297. -----------------------------------
  298. Signature instances also supports the calling API: meaning they
  299. have the ``delay`` and ``apply_async`` methods.
  300. But there's a difference in that the signature may already have
  301. an argument signature specified. The ``add`` task takes two arguments,
  302. so a signature specifying two arguments would make a complete signature:
  303. .. code-block:: pycon
  304. >>> s1 = add.s(2, 2)
  305. >>> res = s1.delay()
  306. >>> res.get()
  307. 4
  308. But, you can also make incomplete signatures to create what we call
  309. *partials*:
  310. .. code-block:: pycon
  311. # incomplete partial: add(?, 2)
  312. >>> s2 = add.s(2)
  313. ``s2`` is now a partial signature that needs another argument to be complete,
  314. and this can be resolved when calling the signature:
  315. .. code-block:: pycon
  316. # resolves the partial: add(8, 2)
  317. >>> res = s2.delay(8)
  318. >>> res.get()
  319. 10
  320. Here you added the argument 8 that was prepended to the existing argument 2
  321. forming a complete signature of ``add(8, 2)``.
  322. Keyword arguments can also be added later, these are then merged with any
  323. existing keyword arguments, but with new arguments taking precedence:
  324. .. code-block:: pycon
  325. >>> s3 = add.s(2, 2, debug=True)
  326. >>> s3.delay(debug=False) # debug is now False.
  327. As stated signatures supports the calling API: meaning that;
  328. - ``sig.apply_async(args=(), kwargs={}, **options)``
  329. Calls the signature with optional partial arguments and partial
  330. keyword arguments. Also supports partial execution options.
  331. - ``sig.delay(*args, **kwargs)``
  332. Star argument version of ``apply_async``. Any arguments will be prepended
  333. to the arguments in the signature, and keyword arguments is merged with any
  334. existing keys.
  335. So this all seems very useful, but what can you actually do with these?
  336. To get to that I must introduce the canvas primitives…
  337. The Primitives
  338. --------------
  339. .. topic:: \
  340. .. hlist::
  341. :columns: 2
  342. - :ref:`group <canvas-group>`
  343. - :ref:`chain <canvas-chain>`
  344. - :ref:`chord <canvas-chord>`
  345. - :ref:`map <canvas-map>`
  346. - :ref:`starmap <canvas-map>`
  347. - :ref:`chunks <canvas-chunks>`
  348. These primitives are signature objects themselves, so they can be combined
  349. in any number of ways to compose complex work-flows.
  350. .. note::
  351. These examples retrieve results, so to try them out you need
  352. to configure a result backend. The example project
  353. above already does that (see the backend argument to :class:`~celery.Celery`).
  354. Let's look at some examples:
  355. Groups
  356. ~~~~~~
  357. A :class:`~celery.group` calls a list of tasks in parallel,
  358. and it returns a special result instance that lets you inspect the results
  359. as a group, and retrieve the return values in order.
  360. .. code-block:: pycon
  361. >>> from celery import group
  362. >>> from proj.tasks import add
  363. >>> group(add.s(i, i) for i in xrange(10))().get()
  364. [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
  365. - Partial group
  366. .. code-block:: pycon
  367. >>> g = group(add.s(i) for i in xrange(10))
  368. >>> g(10).get()
  369. [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
  370. Chains
  371. ~~~~~~
  372. Tasks can be linked together so that after one task returns the other
  373. is called:
  374. .. code-block:: pycon
  375. >>> from celery import chain
  376. >>> from proj.tasks import add, mul
  377. # (4 + 4) * 8
  378. >>> chain(add.s(4, 4) | mul.s(8))().get()
  379. 64
  380. or a partial chain:
  381. .. code-block:: pycon
  382. >>> # (? + 4) * 8
  383. >>> g = chain(add.s(4) | mul.s(8))
  384. >>> g(4).get()
  385. 64
  386. Chains can also be written like this:
  387. .. code-block:: pycon
  388. >>> (add.s(4, 4) | mul.s(8))().get()
  389. 64
  390. Chords
  391. ~~~~~~
  392. A chord is a group with a callback:
  393. .. code-block:: pycon
  394. >>> from celery import chord
  395. >>> from proj.tasks import add, xsum
  396. >>> chord((add.s(i, i) for i in xrange(10)), xsum.s())().get()
  397. 90
  398. A group chained to another task will be automatically converted
  399. to a chord:
  400. .. code-block:: pycon
  401. >>> (group(add.s(i, i) for i in xrange(10)) | xsum.s())().get()
  402. 90
  403. Since these primitives are all of the signature type they
  404. can be combined almost however you want, for example:
  405. .. code-block:: pycon
  406. >>> upload_document.s(file) | group(apply_filter.s() for filter in filters)
  407. Be sure to read more about work-flows in the :ref:`Canvas <guide-canvas>` user
  408. guide.
  409. Routing
  410. =======
  411. Celery supports all of the routing facilities provided by AMQP,
  412. but it also supports simple routing where messages are sent to named queues.
  413. The :setting:`task_routes` setting enables you to route tasks by name
  414. and keep everything centralized in one location:
  415. .. code-block:: python
  416. app.conf.update(
  417. task_routes = {
  418. 'proj.tasks.add': {'queue': 'hipri'},
  419. },
  420. )
  421. You can also specify the queue at runtime
  422. with the ``queue`` argument to ``apply_async``:
  423. .. code-block:: pycon
  424. >>> from proj.tasks import add
  425. >>> add.apply_async((2, 2), queue='hipri')
  426. You can then make a worker consume from this queue by
  427. specifying the :option:`celery worker -Q` option:
  428. .. code-block:: console
  429. $ celery -A proj worker -Q hipri
  430. You may specify multiple queues by using a comma separated list,
  431. for example you can make the worker consume from both the default
  432. queue, and the ``hipri`` queue, where
  433. the default queue is named ``celery`` for historical reasons:
  434. .. code-block:: console
  435. $ celery -A proj worker -Q hipri,celery
  436. The order of the queues doesn't matter as the worker will
  437. give equal weight to the queues.
  438. To learn more about routing, including taking use of the full
  439. power of AMQP routing, see the :ref:`Routing Guide <guide-routing>`.
  440. Remote Control
  441. ==============
  442. If you're using RabbitMQ (AMQP), Redis, or Qpid as the broker then
  443. you can control and inspect the worker at runtime.
  444. For example you can see what tasks the worker is currently working on:
  445. .. code-block:: console
  446. $ celery -A proj inspect active
  447. This is implemented by using broadcast messaging, so all remote
  448. control commands are received by every worker in the cluster.
  449. You can also specify one or more workers to act on the request
  450. using the :option:`--destination <celery inspect --destination>` option.
  451. This is a comma separated list of worker host names:
  452. .. code-block:: console
  453. $ celery -A proj inspect active --destination=celery@example.com
  454. If a destination isn't provided then every worker will act and reply
  455. to the request.
  456. The :program:`celery inspect` command contains commands that
  457. doesn't change anything in the worker, it only replies information
  458. and statistics about what's going on inside the worker.
  459. For a list of inspect commands you can execute:
  460. .. code-block:: console
  461. $ celery -A proj inspect --help
  462. Then there's the :program:`celery control` command, that contains
  463. commands that actually changes things in the worker at runtime:
  464. .. code-block:: console
  465. $ celery -A proj control --help
  466. For example you can force workers to enable event messages (used
  467. for monitoring tasks and workers):
  468. .. code-block:: console
  469. $ celery -A proj control enable_events
  470. When events are enabled you can then start the event dumper
  471. to see what the workers are doing:
  472. .. code-block:: console
  473. $ celery -A proj events --dump
  474. or you can start the curses interface:
  475. .. code-block:: console
  476. $ celery -A proj events
  477. when you're finished monitoring you can disable events again:
  478. .. code-block:: console
  479. $ celery -A proj control disable_events
  480. The :program:`celery status` command also uses remote control commands
  481. and shows a list of online workers in the cluster:
  482. .. code-block:: console
  483. $ celery -A proj status
  484. You can read more about the :program:`celery` command and monitoring
  485. in the :ref:`Monitoring Guide <guide-monitoring>`.
  486. Timezone
  487. ========
  488. All times and dates, internally and in messages uses the UTC timezone.
  489. When the worker receives a message, for example with a countdown set it
  490. converts that UTC time to local time. If you wish to use
  491. a different timezone than the system timezone then you must
  492. configure that using the :setting:`timezone` setting:
  493. .. code-block:: python
  494. app.conf.timezone = 'Europe/London'
  495. Optimization
  496. ============
  497. The default configuration isn't optimized for throughput by default,
  498. it tries to walk the middle way between many short tasks and fewer long
  499. tasks, a compromise between throughput and fair scheduling.
  500. If you have strict fair scheduling requirements, or want to optimize
  501. for throughput then you should read the :ref:`Optimizing Guide
  502. <guide-optimizing>`.
  503. If you're using RabbitMQ then you can install the :pypi:`librabbitmq`
  504. module: this is an AMQP client implemented in C:
  505. .. code-block:: console
  506. $ pip install librabbitmq
  507. What to do now?
  508. ===============
  509. Now that you have read this document you should continue
  510. to the :ref:`User Guide <guide>`.
  511. There's also an :ref:`API reference <apiref>` if you're so inclined.