app.celery.ContextTask

class app.celery.ContextTask

Bases: celery.app.task.Task

Attributes

ContextTask.Request

Request class used, or the qualified name of one.

ContextTask.Strategy

Execution strategy used, or the qualified name of one.

ContextTask.abstract

Deprecated attribute abstract here for compatibility.

ContextTask.acks_late

When enabled messages for this task will be acknowledged after the task has been executed, and not just before (the default behavior).

ContextTask.acks_on_failure_or_timeout

When enabled messages for this task will be acknowledged even if it fails or times out.

ContextTask.app

ContextTask.backend

ContextTask.default_retry_delay

Default time in seconds before a retry of the task should be executed.

ContextTask.expires

Default task expiry time.

ContextTask.from_config

ContextTask.ignore_result

If enabled the worker won't store task state and return values for this task. Defaults to the :setting:`task_ignore_result` setting.

ContextTask.max_retries

Maximum number of retries before giving up.

ContextTask.name

Name of the task.

ContextTask.priority

Default task priority.

ContextTask.rate_limit

None (no rate limit), '100/s' (hundred tasks a second), '100/m' (hundred tasks a minute),`'100/h'` (hundred tasks an hour)

ContextTask.reject_on_worker_lost

Even if acks_late is enabled, the worker will acknowledge tasks when the worker process executing them abruptly exits or is signaled (e.g., :sig:`KILL`/:sig:`INT`, etc).

ContextTask.request

Get current request object.

ContextTask.request_stack

Task request stack, the current request will be the topmost.

ContextTask.resultrepr_maxsize

Max length of result representation used in logs and events.

ContextTask.send_events

If enabled the worker will send monitoring events related to this task (but only if the worker is configured to send task related events).

ContextTask.serializer

The name of a serializer that are registered with kombu.serialization.registry.

ContextTask.soft_time_limit

Soft time limit. Defaults to the :setting:`task_soft_time_limit` setting.

ContextTask.store_eager_result

ContextTask.store_errors_even_if_ignored

When enabled errors will be stored even if the task is otherwise configured to ignore results.

ContextTask.throws

Tuple of expected exceptions.

ContextTask.time_limit

Hard time limit. Defaults to the :setting:`task_time_limit` setting.

ContextTask.track_started

If enabled the task will report its status as 'started' when the task is executed by a worker.

ContextTask.trail

If enabled the request will keep track of subtasks started by this task, and this information will be sent with the result (result.children).

ContextTask.typing

Enable argument checking.

Methods

ContextTask.AsyncResult(task_id, **kwargs)

Get AsyncResult instance for the specified task.

ContextTask.__init__()

ContextTask.add_around(attr, around)

ContextTask.add_to_chord(sig[, lazy])

Add signature to the chord the current task is a member of.

ContextTask.add_trail(result)

ContextTask.after_return(status, retval, ...)

Handler called after the task returns.

ContextTask.annotate()

ContextTask.apply([args, kwargs, link, ...])

Execute this task locally, by blocking until the task returns.

ContextTask.apply_async([args, kwargs, ...])

Apply tasks asynchronously by sending a message.

ContextTask.before_start(task_id, args, kwargs)

Handler called before the task starts.

ContextTask.bind(app)

ContextTask.chunks(it, n)

Create a chunks task for this task.

ContextTask.delay(*args, **kwargs)

Star argument version of apply_async().

ContextTask.map(it)

Create a xmap task from it.

ContextTask.on_bound(app)

Called when the task is bound to an app.

ContextTask.on_failure(exc, task_id, args, ...)

Error handler.

ContextTask.on_retry(exc, task_id, args, ...)

Retry handler.

ContextTask.on_success(retval, task_id, ...)

Success handler.

ContextTask.pop_request()

ContextTask.push_request(*args, **kwargs)

ContextTask.replace(sig)

Replace this task, with a new task inheriting the task id.

ContextTask.retry([args, kwargs, exc, ...])

Retry the task, adding it to the back of the queue.

ContextTask.run(*args, **kwargs)

The body of the task executed by workers.

ContextTask.s(*args, **kwargs)

Create signature.

ContextTask.send_event(type_[, retry, ...])

Send monitoring event message.

ContextTask.shadow_name(args, kwargs, options)

Override for custom task name in worker logs/monitoring.

ContextTask.si(*args, **kwargs)

Create immutable signature.

ContextTask.signature([args])

Create signature.

ContextTask.signature_from_request([...])

ContextTask.starmap(it)

Create a xstarmap task from it.

ContextTask.start_strategy(app, consumer, ...)

ContextTask.subtask([args])

Create signature.

ContextTask.subtask_from_request([request, ...])

ContextTask.update_state([task_id, state, meta])

Update task state.