| 1 |
=========================================== |
| 2 |
:mod:`celery` --- Distributed processing |
| 3 |
=========================================== |
| 4 |
|
| 5 |
.. currentmodule:: celery |
| 6 |
.. module:: celery |
| 7 |
:synopsis: Distributed processing |
| 8 |
.. moduleauthor:: Ask Solem <[email protected]> |
| 9 |
.. sectionauthor:: Ask Solem <[email protected]> |
| 10 |
|
| 11 |
-------------- |
| 12 |
|
| 13 |
This module is the main entry-point for the Celery API. |
| 14 |
It includes commonly needed things for calling tasks, |
| 15 |
and creating Celery applications. |
| 16 |
|
| 17 |
===================== =================================================== |
| 18 |
:class:`Celery` Celery application instance |
| 19 |
:class:`group` group tasks together |
| 20 |
:class:`chain` chain tasks together |
| 21 |
:class:`chord` chords enable callbacks for groups |
| 22 |
:func:`signature` create a new task signature |
| 23 |
:class:`Signature` object describing a task invocation |
| 24 |
:data:`current_app` proxy to the current application instance |
| 25 |
:data:`current_task` proxy to the currently executing task |
| 26 |
===================== =================================================== |
| 27 |
|
| 28 |
:class:`Celery` application objects |
| 29 |
----------------------------------- |
| 30 |
|
| 31 |
.. versionadded:: 2.5 |
| 32 |
|
| 33 |
.. autoclass:: Celery |
| 34 |
|
| 35 |
|
| 36 |
.. autoattribute:: user_options |
| 37 |
|
| 38 |
.. autoattribute:: steps |
| 39 |
|
| 40 |
.. autoattribute:: current_task |
| 41 |
|
| 42 |
.. autoattribute:: current_worker_task |
| 43 |
|
| 44 |
.. autoattribute:: amqp |
| 45 |
|
| 46 |
.. autoattribute:: backend |
| 47 |
|
| 48 |
.. autoattribute:: loader |
| 49 |
|
| 50 |
.. autoattribute:: control |
| 51 |
.. autoattribute:: events |
| 52 |
.. autoattribute:: log |
| 53 |
.. autoattribute:: tasks |
| 54 |
.. autoattribute:: pool |
| 55 |
.. autoattribute:: producer_pool |
| 56 |
.. autoattribute:: Task |
| 57 |
.. autoattribute:: timezone |
| 58 |
.. autoattribute:: builtin_fixups |
| 59 |
.. autoattribute:: oid |
| 60 |
|
| 61 |
.. automethod:: close |
| 62 |
|
| 63 |
.. automethod:: signature |
| 64 |
|
| 65 |
.. automethod:: bugreport |
| 66 |
|
| 67 |
.. automethod:: config_from_object |
| 68 |
|
| 69 |
.. automethod:: config_from_envvar |
| 70 |
|
| 71 |
.. automethod:: autodiscover_tasks |
| 72 |
|
| 73 |
.. automethod:: add_defaults |
| 74 |
|
| 75 |
.. automethod:: add_periodic_task |
| 76 |
|
| 77 |
.. automethod:: setup_security |
| 78 |
|
| 79 |
.. automethod:: task |
| 80 |
|
| 81 |
.. automethod:: send_task |
| 82 |
|
| 83 |
.. automethod:: gen_task_name |
| 84 |
|
| 85 |
.. autoattribute:: AsyncResult |
| 86 |
|
| 87 |
.. autoattribute:: GroupResult |
| 88 |
|
| 89 |
.. autoattribute:: Worker |
| 90 |
|
| 91 |
.. autoattribute:: WorkController |
| 92 |
|
| 93 |
.. autoattribute:: Beat |
| 94 |
|
| 95 |
.. automethod:: connection_for_read |
| 96 |
|
| 97 |
.. automethod:: connection_for_write |
| 98 |
|
| 99 |
.. automethod:: connection |
| 100 |
|
| 101 |
.. automethod:: connection_or_acquire |
| 102 |
|
| 103 |
.. automethod:: producer_or_acquire |
| 104 |
|
| 105 |
.. automethod:: select_queues |
| 106 |
|
| 107 |
.. automethod:: now |
| 108 |
|
| 109 |
.. automethod:: set_current |
| 110 |
|
| 111 |
.. automethod:: set_default |
| 112 |
|
| 113 |
.. automethod:: finalize |
| 114 |
|
| 115 |
.. automethod:: on_init |
| 116 |
|
| 117 |
.. automethod:: prepare_config |
| 118 |
|
| 119 |
.. data:: on_configure |
| 120 |
|
| 121 |
Signal sent when app is loading configuration. |
| 122 |
|
| 123 |
.. data:: on_after_configure |
| 124 |
|
| 125 |
Signal sent after app has prepared the configuration. |
| 126 |
|
| 127 |
.. data:: on_after_finalize |
| 128 |
|
| 129 |
Signal sent after the app has been finalized — that is, after all |
| 130 |
pending task decorators have been evaluated, built-in tasks loaded, |
| 131 |
and every task registered at that point has been bound to the app. |
| 132 |
At this stage the task registry is initialized and stable enough to |
| 133 |
import and inspect task objects reliably. |
| 134 |
|
| 135 |
See :meth:`~celery.Celery.finalize` for more details on what |
| 136 |
finalization does. |
| 137 |
|
| 138 |
.. data:: on_after_fork |
| 139 |
|
| 140 |
Signal sent in child process after fork. |
| 141 |
|
| 142 |
Canvas primitives |
| 143 |
----------------- |
| 144 |
|
| 145 |
See :ref:`guide-canvas` for more about creating task work-flows. |
| 146 |
|
| 147 |
.. autoclass:: group |
| 148 |
|
| 149 |
.. autoclass:: chain |
| 150 |
|
| 151 |
.. autoclass:: chord |
| 152 |
|
| 153 |
.. autofunction:: signature |
| 154 |
|
| 155 |
.. autoclass:: Signature |
| 156 |
|
| 157 |
Proxies |
| 158 |
------- |
| 159 |
|
| 160 |
.. data:: current_app |
| 161 |
|
| 162 |
The currently set app for this thread. |
| 163 |
|
| 164 |
.. data:: current_task |
| 165 |
|
| 166 |
The task currently being executed |
| 167 |
(only set in the worker, or when eager/apply is used). |