Signals¶
Celery uses signals to allow decoupled applications to receive notifications when actions occur elsewhere.
Task signals¶
Celery Signals.
This module defines the signals (Observer pattern) sent by both workers and clients.
Functions can be connected to these signals, and connected functions are called whenever a signal is called.
.. seealso::
:ref:`signals` for more information.
before_task_publish
module-attribute
¶
before_task_publish = Signal(
name="before_task_publish",
providing_args={
"body",
"exchange",
"routing_key",
"headers",
"properties",
"declare",
"retry_policy",
},
)
after_task_publish
module-attribute
¶
after_task_publish = Signal(
name="after_task_publish",
providing_args={"body", "exchange", "routing_key"},
)
task_received
module-attribute
¶
task_prerun
module-attribute
¶
task_postrun
module-attribute
¶
task_postrun = Signal(
name="task_postrun",
providing_args={
"task_id",
"task",
"args",
"kwargs",
"retval",
},
)
task_success
module-attribute
¶
Sent when a task succeeds.
Sender is the task object. result is the return value of the task, and
runtime the time in seconds it took, from the start of tracing until its
callbacks are sent and its result is stored: the time the worker logs in
"Task ... succeeded in ...s".
task_failure
module-attribute
¶
task_failure = Signal(
name="task_failure",
providing_args={
"task_id",
"exception",
"args",
"kwargs",
"traceback",
"einfo",
},
)
task_retry
module-attribute
¶
task_revoked
module-attribute
¶
task_revoked = Signal(
name="task_revoked",
providing_args={
"request",
"terminated",
"signum",
"expired",
},
)
task_rejected
module-attribute
¶
task_unknown
module-attribute
¶
task_internal_error
module-attribute
¶
task_internal_error = Signal(
name="task_internal_error",
providing_args={
"task_id",
"args",
"kwargs",
"request",
"exception",
"traceback",
"einfo",
},
)
Worker signals¶
Celery Signals.
This module defines the signals (Observer pattern) sent by both workers and clients.
Functions can be connected to these signals, and connected functions are called whenever a signal is called.
.. seealso::
:ref:`signals` for more information.
Beat signals¶
Celery Signals.
This module defines the signals (Observer pattern) sent by both workers and clients.
Functions can be connected to these signals, and connected functions are called whenever a signal is called.
.. seealso::
:ref:`signals` for more information.
Logging signals¶
Celery Signals.
This module defines the signals (Observer pattern) sent by both workers and clients.
Functions can be connected to these signals, and connected functions are called whenever a signal is called.
.. seealso::
:ref:`signals` for more information.
setup_logging
module-attribute
¶
setup_logging = Signal(
name="setup_logging",
providing_args={
"loglevel",
"logfile",
"format",
"colorize",
},
)
after_setup_logger
module-attribute
¶
after_setup_logger = Signal(
name="after_setup_logger",
providing_args={
"logger",
"loglevel",
"logfile",
"format",
"colorize",
},
)
after_setup_task_logger
module-attribute
¶
after_setup_task_logger = Signal(
name="after_setup_task_logger",
providing_args={
"logger",
"loglevel",
"logfile",
"format",
"colorize",
},
)