|  | @@ -773,77 +773,137 @@ You can listen to specific events by specifying the handlers:
 | 
	
		
			
				|  |  |  .. _event-reference:
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  Event Reference
 | 
	
		
			
				|  |  | ----------------
 | 
	
		
			
				|  |  | +===============
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  This list contains the events sent by the worker, and their arguments.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  .. _event-reference-task:
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  Task Events
 | 
	
		
			
				|  |  | -~~~~~~~~~~~
 | 
	
		
			
				|  |  | +-----------
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.. event:: task-sent
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +task-sent
 | 
	
		
			
				|  |  | +~~~~~~~~~
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +:signature: ``task-sent(uuid, name, args, kwargs, retries, eta, expires,
 | 
	
		
			
				|  |  | +              queue, exchange, routing_key)``
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +Sent when a task message is published and
 | 
	
		
			
				|  |  | +the :setting:`CELERY_SEND_TASK_SENT_EVENT` setting is enabled.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.. event:: task-received
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +task-received
 | 
	
		
			
				|  |  | +~~~~~~~~~~~~~
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +:signature: ``task-received(uuid, name, args, kwargs, retries, eta, hostname,
 | 
	
		
			
				|  |  | +              timestamp)``
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +Sent when the worker receives a task.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.. event:: task-started
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +task-started
 | 
	
		
			
				|  |  | +~~~~~~~~~~~~
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``task-sent(uuid, name, args, kwargs, retries, eta, expires,
 | 
	
		
			
				|  |  | -  queue, exchange, routing_key)``
 | 
	
		
			
				|  |  | +:signature: ``task-started(uuid, hostname, timestamp, pid)``
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -   Sent when a task message is published and
 | 
	
		
			
				|  |  | -   the :setting:`CELERY_SEND_TASK_SENT_EVENT` setting is enabled.
 | 
	
		
			
				|  |  | +Sent just before the worker executes the task.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``task-received(uuid, name, args, kwargs, retries, eta, hostname,
 | 
	
		
			
				|  |  | -  timestamp)``
 | 
	
		
			
				|  |  | +.. event:: task-succeeded
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Sent when the worker receives a task.
 | 
	
		
			
				|  |  | +task-succeeded
 | 
	
		
			
				|  |  | +~~~~~~~~~~~~~~
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``task-started(uuid, hostname, timestamp, pid)``
 | 
	
		
			
				|  |  | +:signature: ``task-succeeded(uuid, result, runtime, hostname, timestamp)``
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Sent just before the worker executes the task.
 | 
	
		
			
				|  |  | +Sent if the task executed successfully.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``task-succeeded(uuid, result, runtime, hostname, timestamp)``
 | 
	
		
			
				|  |  | +Runtime is the time it took to execute the task using the pool.
 | 
	
		
			
				|  |  | +(Starting from the task is sent to the worker pool, and ending when the
 | 
	
		
			
				|  |  | +pool result handler callback is called).
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Sent if the task executed successfully.
 | 
	
		
			
				|  |  | +.. event:: task-failed
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Runtime is the time it took to execute the task using the pool.
 | 
	
		
			
				|  |  | -    (Starting from the task is sent to the worker pool, and ending when the
 | 
	
		
			
				|  |  | -    pool result handler callback is called).
 | 
	
		
			
				|  |  | +task-failed
 | 
	
		
			
				|  |  | +~~~~~~~~~~~
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +:signature: ``task-failed(uuid, exception, traceback, hostname, timestamp)``
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +Sent if the execution of the task failed.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``task-failed(uuid, exception, traceback, hostname, timestamp)``
 | 
	
		
			
				|  |  | +.. event:: task-revoked
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Sent if the execution of the task failed.
 | 
	
		
			
				|  |  | +task-revoked
 | 
	
		
			
				|  |  | +~~~~~~~~~~~~
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``task-revoked(uuid, terminated, signum, expired)``
 | 
	
		
			
				|  |  | +:signature: ``task-revoked(uuid, terminated, signum, expired)``
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Sent if the task has been revoked (Note that this is likely
 | 
	
		
			
				|  |  | -    to be sent by more than one worker).
 | 
	
		
			
				|  |  | +Sent if the task has been revoked (Note that this is likely
 | 
	
		
			
				|  |  | +to be sent by more than one worker).
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    - ``terminated`` is set to true if the task process was terminated,
 | 
	
		
			
				|  |  | -      and the ``signum`` field set to the signal used.
 | 
	
		
			
				|  |  | +- ``terminated`` is set to true if the task process was terminated,
 | 
	
		
			
				|  |  | +    and the ``signum`` field set to the signal used.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    - ``expired`` is set to true if the task expired.
 | 
	
		
			
				|  |  | +- ``expired`` is set to true if the task expired.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``task-retried(uuid, exception, traceback, hostname, timestamp)``
 | 
	
		
			
				|  |  | +.. event:: task-retried
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Sent if the task failed, but will be retried in the future.
 | 
	
		
			
				|  |  | +task-retried
 | 
	
		
			
				|  |  | +~~~~~~~~~~~~
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +:signature: ``task-retried(uuid, exception, traceback, hostname, timestamp)``
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +Sent if the task failed, but will be retried in the future.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  .. _event-reference-worker:
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  Worker Events
 | 
	
		
			
				|  |  | +-------------
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.. event:: worker-online
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +worker-online
 | 
	
		
			
				|  |  |  ~~~~~~~~~~~~~
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``worker-online(hostname, timestamp, freq, sw_ident, sw_ver, sw_sys)``
 | 
	
		
			
				|  |  | +:signature: ``worker-online(hostname, timestamp, freq, sw_ident, sw_ver, sw_sys)``
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +The worker has connected to the broker and is online.
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +- `hostname`: Hostname of the worker.
 | 
	
		
			
				|  |  | +- `timestamp`: Event timestamp.
 | 
	
		
			
				|  |  | +- `freq`: Heartbeat frequency in seconds (float).
 | 
	
		
			
				|  |  | +- `sw_ident`: Name of worker software (e.g. ``py-celery``).
 | 
	
		
			
				|  |  | +- `sw_ver`: Software version (e.g. 2.2.0).
 | 
	
		
			
				|  |  | +- `sw_sys`: Operating System (e.g. Linux, Windows, Darwin).
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +.. event:: worker-heartbeat
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +worker-heartbeat
 | 
	
		
			
				|  |  | +~~~~~~~~~~~~~~~~
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +:signature: ``worker-heartbeat(hostname, timestamp, freq, sw_ident, sw_ver, sw_sys,
 | 
	
		
			
				|  |  | +              active, processed)``
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    The worker has connected to the broker and is online.
 | 
	
		
			
				|  |  | +Sent every minute, if the worker has not sent a heartbeat in 2 minutes,
 | 
	
		
			
				|  |  | +it is considered to be offline.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    * `hostname`: Hostname of the worker.
 | 
	
		
			
				|  |  | -    * `timestamp`: Event timestamp.
 | 
	
		
			
				|  |  | -    * `freq`: Heartbeat frequency in seconds (float).
 | 
	
		
			
				|  |  | -    * `sw_ident`: Name of worker software (e.g. ``py-celery``).
 | 
	
		
			
				|  |  | -    * `sw_ver`: Software version (e.g. 2.2.0).
 | 
	
		
			
				|  |  | -    * `sw_sys`: Operating System (e.g. Linux, Windows, Darwin).
 | 
	
		
			
				|  |  | +- `hostname`: Hostname of the worker.
 | 
	
		
			
				|  |  | +- `timestamp`: Event timestamp.
 | 
	
		
			
				|  |  | +- `freq`: Heartbeat frequency in seconds (float).
 | 
	
		
			
				|  |  | +- `sw_ident`: Name of worker software (e.g. ``py-celery``).
 | 
	
		
			
				|  |  | +- `sw_ver`: Software version (e.g. 2.2.0).
 | 
	
		
			
				|  |  | +- `sw_sys`: Operating System (e.g. Linux, Windows, Darwin).
 | 
	
		
			
				|  |  | +- `active`: Number of currently executing tasks.
 | 
	
		
			
				|  |  | +- `processed`: Total number of tasks processed by this worker.
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``worker-heartbeat(hostname, timestamp, freq, sw_ident, sw_ver, sw_sys)``
 | 
	
		
			
				|  |  | +.. event:: worker-offline
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    Sent every minute, if the worker has not sent a heartbeat in 2 minutes,
 | 
	
		
			
				|  |  | -    it is considered to be offline.
 | 
	
		
			
				|  |  | +worker-offline
 | 
	
		
			
				|  |  | +~~~~~~~~~~~~~~
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -* ``worker-offline(hostname, timestamp, freq, sw_ident, sw_ver, sw_sys)``
 | 
	
		
			
				|  |  | +:signature: ``worker-offline(hostname, timestamp, freq, sw_ident, sw_ver, sw_sys)``
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    The worker has disconnected from the broker.
 | 
	
		
			
				|  |  | +The worker has disconnected from the broker.
 |