1.. _deprecation-timeline: 2 3============================== 4 Celery Deprecation Time-line 5============================== 6 7.. contents:: 8 :local: 9 10.. _deprecations-v5.0: 11 12Removals for version 5.0 13======================== 14 15Old Task API 16------------ 17 18.. _deprecate-compat-task-modules: 19 20Compat Task Modules 21~~~~~~~~~~~~~~~~~~~ 22 23- Module ``celery.decorators`` will be removed: 24 25 This means you need to change: 26 27 .. code-block:: python 28 29 from celery.decorators import task 30 31 Into: 32 33 .. code-block:: python 34 35 from celery import task 36 37- Module ``celery.task`` *may* be removed (not decided) 38 39 This means you should change: 40 41 .. code-block:: python 42 43 from celery.task import task 44 45 into: 46 47 .. code-block:: python 48 49 from celery import task 50 51 -- and: 52 53 .. code-block:: python 54 55 from celery.task import Task 56 57 into: 58 59 .. code-block:: python 60 61 from celery import Task 62 63 64Note that the new :class:`~celery.Task` class no longer 65uses :func:`classmethod` for these methods: 66 67 - delay 68 - apply_async 69 - retry 70 - apply 71 - AsyncResult 72 - subtask 73 74This also means that you can't call these methods directly 75on the class, but have to instantiate the task first: 76 77.. code-block:: pycon 78 79 >>> MyTask.delay() # NO LONGER WORKS 80 81 82 >>> MyTask().delay() # WORKS! 83 84 85Task attributes 86--------------- 87 88The task attributes: 89 90- ``queue`` 91- ``exchange`` 92- ``exchange_type`` 93- ``routing_key`` 94- ``delivery_mode`` 95- ``priority`` 96 97is deprecated and must be set by :setting:`task_routes` instead. 98 99 100Modules to Remove 101----------------- 102 103- ``celery.execute`` 104 105 This module only contains ``send_task``: this must be replaced with 106 :attr:`@send_task` instead. 107 108- ``celery.decorators`` 109 110 See :ref:`deprecate-compat-task-modules` 111 112- ``celery.log`` 113 114 Use :attr:`@log` instead. 115 116- ``celery.messaging`` 117 118 Use :attr:`@amqp` instead. 119 120- ``celery.registry`` 121 122 Use :mod:`celery.app.registry` instead. 123 124- ``celery.task.control`` 125 126 Use :attr:`@control` instead. 127 128- ``celery.task.schedules`` 129 130 Use :mod:`celery.schedules` instead. 131 132- ``celery.task.chords`` 133 134 Use :func:`celery.chord` instead. 135 136Settings 137-------- 138 139``BROKER`` Settings 140~~~~~~~~~~~~~~~~~~~ 141 142===================================== ===================================== 143**Setting name** **Replace with** 144===================================== ===================================== 145``BROKER_HOST`` :setting:`broker_url` 146``BROKER_PORT`` :setting:`broker_url` 147``BROKER_USER`` :setting:`broker_url` 148``BROKER_PASSWORD`` :setting:`broker_url` 149``BROKER_VHOST`` :setting:`broker_url` 150===================================== ===================================== 151 152``REDIS`` Result Backend Settings 153~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 154 155===================================== ===================================== 156**Setting name** **Replace with** 157===================================== ===================================== 158``CELERY_REDIS_HOST`` :setting:`result_backend` 159``CELERY_REDIS_PORT`` :setting:`result_backend` 160``CELERY_REDIS_DB`` :setting:`result_backend` 161``CELERY_REDIS_PASSWORD`` :setting:`result_backend` 162``REDIS_HOST`` :setting:`result_backend` 163``REDIS_PORT`` :setting:`result_backend` 164``REDIS_DB`` :setting:`result_backend` 165``REDIS_PASSWORD`` :setting:`result_backend` 166===================================== ===================================== 167 168 169Task_sent signal 170---------------- 171 172The :signal:`task_sent` signal will be removed in version 4.0. 173Please use the :signal:`before_task_publish` and :signal:`after_task_publish` 174signals instead. 175 176Result 177------ 178 179Apply to: :class:`~celery.result.AsyncResult`, 180:class:`~celery.result.EagerResult`: 181 182- ``Result.wait()`` -> ``Result.get()`` 183 184- ``Result.task_id()`` -> ``Result.id`` 185 186- ``Result.status`` -> ``Result.state``. 187 188.. _deprecations-v3.1: 189 190 191Settings 192~~~~~~~~ 193 194===================================== ===================================== 195**Setting name** **Replace with** 196===================================== ===================================== 197``CELERY_AMQP_TASK_RESULT_EXPIRES`` :setting:`result_expires` 198===================================== ===================================== 199 200 201 202.. _deprecations-v2.0: 203 204Removals for version 2.0 205======================== 206 207* The following settings will be removed: 208 209===================================== ===================================== 210**Setting name** **Replace with** 211===================================== ===================================== 212`CELERY_AMQP_CONSUMER_QUEUES` `task_queues` 213`CELERY_AMQP_CONSUMER_QUEUES` `task_queues` 214`CELERY_AMQP_EXCHANGE` `task_default_exchange` 215`CELERY_AMQP_EXCHANGE_TYPE` `task_default_exchange_type` 216`CELERY_AMQP_CONSUMER_ROUTING_KEY` `task_queues` 217`CELERY_AMQP_PUBLISHER_ROUTING_KEY` `task_default_routing_key` 218===================================== ===================================== 219 220* :envvar:`CELERY_LOADER` definitions without class name. 221 222 For example,, `celery.loaders.default`, needs to include the class name: 223 `celery.loaders.default.Loader`. 224 225* :meth:`TaskSet.run`. Use :meth:`celery.task.base.TaskSet.apply_async` 226 instead. 227