deprecation.rst 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. .. _deprecation-timeline:
  2. =============================
  3. Celery Deprecation Timeline
  4. =============================
  5. .. contents::
  6. :local:
  7. .. _deprecations-v5.0:
  8. Removals for version 5.0
  9. ========================
  10. Old Task API
  11. ------------
  12. .. _deprecate-compat-task-modules:
  13. Compat Task Modules
  14. ~~~~~~~~~~~~~~~~~~~
  15. - Module ``celery.decorators`` will be removed:
  16. Which means you need to change::
  17. from celery.decorators import task
  18. Into::
  19. from celery import task
  20. - Module ``celery.task`` *may* be removed (not decided)
  21. This means you should change::
  22. from celery.task import task
  23. into::
  24. from celery import task
  25. -- and::
  26. from celery.task import Task
  27. into::
  28. from celery import Task
  29. Note that the new :class:`~celery.Task` class no longer
  30. uses classmethods for these methods:
  31. - delay
  32. - apply_async
  33. - retry
  34. - apply
  35. - AsyncResult
  36. - subtask
  37. This also means that you can't call these methods directly
  38. on the class, but have to instantiate the task first::
  39. >>> MyTask.delay() # NO LONGER WORKS
  40. >>> MyTask().delay() # WORKS!
  41. Task attributes
  42. ---------------
  43. The task attributes:
  44. - ``queue``
  45. - ``exchange``
  46. - ``exchange_type``
  47. - ``routing_key``
  48. - ``delivery_mode``
  49. - ``priority``
  50. is deprecated and must be set by :setting:`task_routes` instead.
  51. Modules to Remove
  52. -----------------
  53. - ``celery.execute``
  54. This module only contains ``send_task``, which must be replaced with
  55. :attr:`@send_task` instead.
  56. - ``celery.decorators``
  57. See :ref:`deprecate-compat-task-modules`
  58. - ``celery.log``
  59. Use :attr:`@log` instead.
  60. - ``celery.messaging``
  61. Use :attr:`@amqp` instead.
  62. - ``celery.registry``
  63. Use :mod:`celery.app.registry` instead.
  64. - ``celery.task.control``
  65. Use :attr:`@control` instead.
  66. - ``celery.task.schedules``
  67. Use :mod:`celery.schedules` instead.
  68. - ``celery.task.chords``
  69. Use :func:`celery.chord` instead.
  70. Settings
  71. --------
  72. ``BROKER`` Settings
  73. ~~~~~~~~~~~~~~~~~~~
  74. ===================================== =====================================
  75. **Setting name** **Replace with**
  76. ===================================== =====================================
  77. ``BROKER_HOST`` :setting:`broker_url`
  78. ``BROKER_PORT`` :setting:`broker_url`
  79. ``BROKER_USER`` :setting:`broker_url`
  80. ``BROKER_PASSWORD`` :setting:`broker_url`
  81. ``BROKER_VHOST`` :setting:`broker_url`
  82. ===================================== =====================================
  83. ``REDIS`` Result Backend Settings
  84. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. ===================================== =====================================
  86. **Setting name** **Replace with**
  87. ===================================== =====================================
  88. ``CELERY_REDIS_HOST`` :setting:`result_backend`
  89. ``CELERY_REDIS_PORT`` :setting:`result_backend`
  90. ``CELERY_REDIS_DB`` :setting:`result_backend`
  91. ``CELERY_REDIS_PASSWORD`` :setting:`result_backend`
  92. ``REDIS_HOST`` :setting:`result_backend`
  93. ``REDIS_PORT`` :setting:`result_backend`
  94. ``REDIS_DB`` :setting:`result_backend`
  95. ``REDIS_PASSWORD`` :setting:`result_backend`
  96. ===================================== =====================================
  97. Task_sent signal
  98. ----------------
  99. The :signal:`task_sent` signal will be removed in version 4.0.
  100. Please use the :signal:`before_task_publish` and :signal:`after_task_publish`
  101. signals instead.
  102. Result
  103. ------
  104. Apply to: :class:`~celery.result.AsyncResult`,
  105. :class:`~celery.result.EagerResult`::
  106. - ``Result.wait()`` -> ``Result.get()``
  107. - ``Result.task_id()`` -> ``Result.id``
  108. - ``Result.status`` -> ``Result.state``.
  109. .. _deprecations-v3.1:
  110. Settings
  111. ~~~~~~~~
  112. ===================================== =====================================
  113. **Setting name** **Replace with**
  114. ===================================== =====================================
  115. ``CELERY_TASK_ERROR_WITELIST`` Annotate ``Task.ErrorMail``
  116. ``CELERY_AMQP_TASK_RESULT_EXPIRES`` :setting:`result_expires`
  117. ===================================== =====================================
  118. .. _deprecations-v2.0:
  119. Removals for version 2.0
  120. ========================
  121. * The following settings will be removed:
  122. ===================================== =====================================
  123. **Setting name** **Replace with**
  124. ===================================== =====================================
  125. `CELERY_AMQP_CONSUMER_QUEUES` `task_queues`
  126. `CELERY_AMQP_CONSUMER_QUEUES` `task_queues`
  127. `CELERY_AMQP_EXCHANGE` `task_default_exchange`
  128. `CELERY_AMQP_EXCHANGE_TYPE` `task_default_exchange_type`
  129. `CELERY_AMQP_CONSUMER_ROUTING_KEY` `task_queues`
  130. `CELERY_AMQP_PUBLISHER_ROUTING_KEY` `task_default_routing_key`
  131. ===================================== =====================================
  132. * :envvar:`CELERY_LOADER` definitions without class name.
  133. E.g. `celery.loaders.default`, needs to include the class name:
  134. `celery.loaders.default.Loader`.
  135. * :meth:`TaskSet.run`. Use :meth:`celery.task.base.TaskSet.apply_async`
  136. instead.
  137. * The module :mod:`celery.task.rest`; use :mod:`celery.task.httpY` instead.