MCPcopy Create free account
hub / github.com/celery/celery / Task

Class Task

celery/app/task.py:230–1374  ·  view source on GitHub ↗

Task base class. Note: When called tasks apply the :meth:`run` method. This method must be defined by all tasks (that is unless the :meth:`__call__` method is overridden).

Source from the content-addressed store, hash-verified

228
229@abstract.CallableTask.register
230class Task:
231 """Task base class.
232
233 Note:
234 When called tasks apply the :meth:`run` method. This method must
235 be defined by all tasks (that is unless the :meth:`__call__` method
236 is overridden).
237 """
238
239 __trace__ = None
240 __v2_compat__ = False # set by old base in celery.task.base
241
242 MaxRetriesExceededError = MaxRetriesExceededError
243 OperationalError = OperationalError
244
245 #: Execution strategy used, or the qualified name of one.
246 Strategy = 'celery.worker.strategy:default'
247
248 #: Request class used, or the qualified name of one.
249 Request = 'celery.worker.request:Request'
250
251 #: The application instance associated with this task class.
252 _app = None
253
254 #: Name of the task.
255 name = None
256
257 #: Enable argument checking.
258 #: You can set this to false if you don't want the signature to be
259 #: checked when calling the task.
260 #: Defaults to :attr:`app.strict_typing <@Celery.strict_typing>`.
261 typing = None
262
263 #: Maximum number of retries before giving up. If set to :const:`None`,
264 #: it will **never** stop retrying.
265 max_retries = 3
266
267 #: Default time in seconds before a retry of the task should be
268 #: executed. 3 minutes by default.
269 default_retry_delay = 3 * 60
270
271 #: Rate limit for this task type. Examples: :const:`None` (no rate
272 #: limit), `'100/s'` (hundred tasks a second), `'100/m'` (hundred tasks
273 #: a minute),`'100/h'` (hundred tasks an hour)
274 rate_limit = None
275
276 #: If enabled the worker won't store task state and return values
277 #: for this task. Defaults to the :setting:`task_ignore_result`
278 #: setting.
279 ignore_result = None
280
281 #: If enabled the request will keep track of subtasks started by
282 #: this task, and this information will be sent with the result
283 #: (``result.children``).
284 trail = True
285
286 #: If enabled the worker will send monitoring events related to
287 #: this task (but only if the worker is configured to send

Callers

nothing calls this directly

Calls 1

class_propertyClass · 0.90

Tested by

no test coverage detected