worker.request

Task request.

This module defines the Request class, that specifies how tasks are executed.

Module Contents

Classes

Request(self,message,on_ack=noop,hostname=None,eventer=None,app=None,connection_errors=None,request_dict=None,task=None,on_reject=noop,body=None,headers=None,decoded=False,utc=True,maybe_make_aware=maybe_make_aware,maybe_iso8601=maybe_iso8601,**opts) A request for task execution.

Functions

__optimize__()
create_request_cls(base,task,pool,hostname,eventer,ref=ref,revoked_tasks=revoked_tasks,task_ready=task_ready,trace=trace_task_ret)
__optimize__()
class Request(message, on_ack=noop, hostname=None, eventer=None, app=None, connection_errors=None, request_dict=None, task=None, on_reject=noop, body=None, headers=None, decoded=False, utc=True, maybe_make_aware=maybe_make_aware, maybe_iso8601=maybe_iso8601, **opts)

A request for task execution.

__init__(message, on_ack=noop, hostname=None, eventer=None, app=None, connection_errors=None, request_dict=None, task=None, on_reject=noop, body=None, headers=None, decoded=False, utc=True, maybe_make_aware=maybe_make_aware, maybe_iso8601=maybe_iso8601, **opts)
delivery_info()
execute_using_pool(pool, **kwargs)

Used by the worker to send this task to the pool.

Arguments:
pool (~celery.concurrency.base.TaskPool): The execution pool
used to execute this request.
Raises:
celery.exceptions.TaskRevokedError: if the task was revoked.
execute(loglevel=None, logfile=None)

Execute the task in a trace_task().

Arguments:
loglevel (int): The loglevel used by the task. logfile (str): The logfile used by the task.
maybe_expire()

If expired, mark the task as revoked.

terminate(pool, signal=None)
_announce_revoked(reason, terminated, signum, expired)
revoked()

If revoked, skip task and mark state.

send_event(type, **fields)
on_accepted(pid, time_accepted)

Handler called when task is accepted by worker pool.

on_timeout(soft, timeout)

Handler called if the task times out.

on_success(failed__retval__runtime, **kwargs)

Handler called if the task was successfully processed.

on_retry(exc_info)

Handler called if the task should be retried.

on_failure(exc_info, send_failed_event=True, return_ok=False)

Handler called if the task raised an exception.

acknowledge()

Acknowledge task.

reject(requeue=False)
info(safe=False)
humaninfo()
__str__()

str(self).

__repr__()

repr(self).

tzlocal()
store_errors()
task_id()
task_id(value)
task_name()
task_name(value)
reply_to()
correlation_id()
_payload()
chord()
errbacks()
group()
create_request_cls(base, task, pool, hostname, eventer, ref=ref, revoked_tasks=revoked_tasks, task_ready=task_ready, trace=trace_task_ret)