celery.worker.job

    class celery.worker.job.Request(body, on_ack=<function noop at 0xb08df7c>, hostname=None, eventer=None, app=None, connection_errors=None, request_dict=None, message=None, task=None, on_reject=<function noop at 0xb08df7c>, \*opts*)

    A request for task execution.

    • acknowledge()[源代码]

      Acknowledge task.

    • acknowledged None

    • app None

    • args None

    • connection_errors None

    • correlation_id None

    • delivery_info None

    • error_msg = u’ Task %(name)s[%(id)s] %(description)s: %(exc)s\n ‘

      Format string used to log task failure.

    • eta None

    • eventer None

    • execute(loglevel=None, logfile=None)

      Execute the task in a trace_task().

    • execute_using_pool(pool, \*kwargs*)

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

      参数:pool – A celery.concurrency.base.TaskPool instance.
      引发 celery.exceptions.TaskRevokedError:
       if the task was revoked and ignored.
    • extend_with_default_kwargs()

      Extend the tasks keyword arguments with standard task arguments.

      Currently these are logfile, loglevel, task_id, task_name, task_retries, and delivery_info.

      Magic keyword arguments are deprecated and will be removed in version 4.0.

    • hostname None

    • id None

    • ignored_msg = u’ Task %(name)s[%(id)s] %(description)s\n ‘

    • info(safe=False)[源代码]

    • internal_error_msg = u’ Task %(name)s[%(id)s] %(description)s: %(exc)s\n ‘

      Format string used to log internal error.

    • kwargs None

    • maybe_expire()

      If expired, mark the task as revoked.

    • name None

    • on_accepted(pid, time_accepted)[源代码]

      Handler called when task is accepted by worker pool.

    • on_ack None

    • on_failure(exc_info)

      Handler called if the task raised an exception.

    • on_reject None

    • on_retry(exc_info)[源代码]

      Handler called if the task should be retried.

    • on_success(ret_value, now=None, nowfun=<function _monotonic at 0x93ee4c4>)

      Handler called if the task was successfully processed.

    • on_timeout(soft, timeout)[源代码]

    • rejected_msg = u’ Task %(name)s[%(id)s] %(exc)s\n ‘

    • reply_to None

    • repr_result(result, maxlen=128)

    • request_dict None

    • retry_msg = u’Task %(name)s[%(id)s] retry: %(exc)s’

      Format string used to log task retry.

    • revoked()[源代码]

      If revoked, skip task and mark state.

    • send_event(type, \*fields*)

    • shortinfo()

    • store_errors None[源代码]

    • success_msg = u’ Task %(name)s[%(id)s] succeeded in %(runtime)ss: %(return_value)s\n ‘

      Format string used to log task success.

    • task None

    • task_id None

    • task_name None

    • terminate(pool, signal=None)

    • time_start None

    • tzlocal None[源代码]

    • worker_pid None