celery.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ===========================================
  2. :mod:`celery` --- Distributed processing
  3. ===========================================
  4. .. currentmodule:: celery
  5. .. module:: celery
  6. :synopsis: Distributed processing
  7. .. moduleauthor:: Ask Solem <ask@celeryproject.org>
  8. .. sectionauthor:: Ask Solem <ask@celeryproject.org>
  9. --------------
  10. This module is the main entry-point for the Celery API.
  11. It includes commonly needed things for calling tasks,
  12. and creating Celery applications.
  13. ===================== ===================================================
  14. :class:`Celery` Celery application instance
  15. :class:`group` group tasks together
  16. :class:`chain` chain tasks together
  17. :class:`chord` chords enable callbacks for groups
  18. :func:`signature` create a new task signature
  19. :class:`Signature` object describing a task invocation
  20. :data:`current_app` proxy to the current application instance
  21. :data:`current_task` proxy to the currently executing task
  22. ===================== ===================================================
  23. :class:`Celery` application objects
  24. -----------------------------------
  25. .. versionadded:: 2.5
  26. .. autoclass:: Celery
  27. .. autoattribute:: user_options
  28. .. autoattribute:: steps
  29. .. autoattribute:: current_task
  30. .. autoattribute:: current_worker_task
  31. .. autoattribute:: amqp
  32. .. autoattribute:: backend
  33. .. autoattribute:: loader
  34. .. autoattribute:: control
  35. .. autoattribute:: events
  36. .. autoattribute:: log
  37. .. autoattribute:: tasks
  38. .. autoattribute:: pool
  39. .. autoattribute:: producer_pool
  40. .. autoattribute:: Task
  41. .. autoattribute:: timezone
  42. .. autoattribute:: builtin_fixups
  43. .. autoattribute:: oid
  44. .. automethod:: close
  45. .. automethod:: signature
  46. .. automethod:: bugreport
  47. .. automethod:: config_from_object
  48. .. automethod:: config_from_envvar
  49. .. automethod:: autodiscover_tasks
  50. .. automethod:: add_defaults
  51. .. automethod:: add_periodic_task
  52. .. automethod:: setup_security
  53. .. automethod:: start
  54. .. automethod:: task
  55. .. automethod:: send_task
  56. .. automethod:: gen_task_name
  57. .. autoattribute:: AsyncResult
  58. .. autoattribute:: GroupResult
  59. .. automethod:: worker_main
  60. .. autoattribute:: Worker
  61. .. autoattribute:: WorkController
  62. .. autoattribute:: Beat
  63. .. automethod:: connection_for_read
  64. .. automethod:: connection_for_write
  65. .. automethod:: connection
  66. .. automethod:: connection_or_acquire
  67. .. automethod:: producer_or_acquire
  68. .. automethod:: select_queues
  69. .. automethod:: now
  70. .. automethod:: set_current
  71. .. automethod:: set_default
  72. .. automethod:: finalize
  73. .. automethod:: on_init
  74. .. automethod:: prepare_config
  75. .. data:: on_configure
  76. Signal sent when app is loading configuration.
  77. .. data:: on_after_configure
  78. Signal sent after app has prepared the configuration.
  79. .. data:: on_after_finalize
  80. Signal sent after app has been finalized.
  81. .. data:: on_after_fork
  82. Signal sent in child process after fork.
  83. Canvas primitives
  84. -----------------
  85. See :ref:`guide-canvas` for more about creating task work-flows.
  86. .. autoclass:: group
  87. .. autoclass:: chain
  88. .. autoclass:: chord
  89. .. autofunction:: signature
  90. .. autoclass:: Signature
  91. Proxies
  92. -------
  93. .. data:: current_app
  94. The currently set app for this thread.
  95. .. data:: current_task
  96. The task currently being executed
  97. (only set in the worker, or when eager/apply is used).