Explorar el Código

Adds :event: refs

Ask Solem hace 12 años
padre
commit
02656d7a86

+ 4 - 4
Changelog

@@ -55,7 +55,7 @@ If you're looking for versions prior to 3.x you should see :ref:`history`.
     - Fixes an infinite loop that could happen when retrying establishing
     - Fixes an infinite loop that could happen when retrying establishing
       the broker connection.
       the broker connection.
 
 
-- Daemons now redirect standard file descriptors to /dev/null
+- Daemons now redirect standard file descriptors to :file:`/dev/null`
 
 
     Though by default the standard outs are also redirected
     Though by default the standard outs are also redirected
     to the logger instead, but you can disable this by changing
     to the logger instead, but you can disable this by changing
@@ -80,7 +80,7 @@ If you're looking for versions prior to 3.x you should see :ref:`history`.
 
 
 - Celery command: Extensions are now sorted by name.
 - Celery command: Extensions are now sorted by name.
 
 
-- A regression caused the ``task-failed`` event to be sent
+- A regression caused the :event:`task-failed` event to be sent
   with the exception object instead of its string representation.
   with the exception object instead of its string representation.
 
 
 - The worker daemon would try to create the pid file before daemonizing
 - The worker daemon would try to create the pid file before daemonizing
@@ -142,7 +142,7 @@ If you're looking for versions prior to 3.x you should see :ref:`history`.
 
 
 - ``AsyncResult.revoke`` now accepts ``terminate`` and ``signal`` arguments.
 - ``AsyncResult.revoke`` now accepts ``terminate`` and ``signal`` arguments.
 
 
-- The ``task-revoked`` event now includes new fields: ``terminated``,
+- The :event:`task-revoked` event now includes new fields: ``terminated``,
   ``signum``, and ``expired``.
   ``signum``, and ``expired``.
 
 
 - The argument to :class:`~celery.exceptions.TaskRevokedError` is now one
 - The argument to :class:`~celery.exceptions.TaskRevokedError` is now one
@@ -452,7 +452,7 @@ If you're looking for versions prior to 3.x you should see :ref:`history`.
     - :func:`~celery.contrib.migrate.move_tasks`
     - :func:`~celery.contrib.migrate.move_tasks`
     - :func:`~celery.contrib.migrate.move_task_by_id`
     - :func:`~celery.contrib.migrate.move_task_by_id`
 
 
-- The task-sent event now contains ``exchange`` and ``routing_key``
+- The :event:`task-sent` event now contains ``exchange`` and ``routing_key``
   fields.
   fields.
 
 
 - Fixes bug with installing on Python 3.
 - Fixes bug with installing on Python 3.

+ 12 - 12
celery/events/state.py

@@ -55,17 +55,17 @@ class Worker(Element):
         self.heartbeats = []
         self.heartbeats = []
 
 
     def on_online(self, timestamp=None, **kwargs):
     def on_online(self, timestamp=None, **kwargs):
-        """Callback for the `worker-online` event."""
+        """Callback for the :event:`worker-online` event."""
         self.update(**kwargs)
         self.update(**kwargs)
         self._heartpush(timestamp)
         self._heartpush(timestamp)
 
 
     def on_offline(self, **kwargs):
     def on_offline(self, **kwargs):
-        """Callback for the `worker-offline` event."""
+        """Callback for the :event:`worker-offline` event."""
         self.update(**kwargs)
         self.update(**kwargs)
         self.heartbeats = []
         self.heartbeats = []
 
 
     def on_heartbeat(self, timestamp=None, **kwargs):
     def on_heartbeat(self, timestamp=None, **kwargs):
-        """Callback for the `worker-heartbeat` event."""
+        """Callback for the :event:`worker-heartbeat` event."""
         self.update(**kwargs)
         self.update(**kwargs)
         self._heartpush(timestamp)
         self._heartpush(timestamp)
 
 
@@ -93,8 +93,8 @@ class Task(Element):
     """Task State."""
     """Task State."""
 
 
     #: How to merge out of order events.
     #: How to merge out of order events.
-    #: Disorder is detected by logical ordering (e.g. task-received must have
-    #: happened before a task-failed event).
+    #: Disorder is detected by logical ordering (e.g. :event:`task-received`
+    #: must have happened before a :event:`task-failed` event).
     #:
     #:
     #: A merge rule consists of a state and a list of fields to keep from
     #: A merge rule consists of a state and a list of fields to keep from
     #: that state. ``(RECEIVED, ('name', 'args')``, means the name and args
     #: that state. ``(RECEIVED, ('name', 'args')``, means the name and args
@@ -147,37 +147,37 @@ class Task(Element):
             super(Task, self).update(fields)
             super(Task, self).update(fields)
 
 
     def on_sent(self, timestamp=None, **fields):
     def on_sent(self, timestamp=None, **fields):
-        """Callback for the ``task-sent`` event."""
+        """Callback for the :event:`task-sent` event."""
         self.sent = timestamp
         self.sent = timestamp
         self.update(states.PENDING, timestamp, fields)
         self.update(states.PENDING, timestamp, fields)
 
 
     def on_received(self, timestamp=None, **fields):
     def on_received(self, timestamp=None, **fields):
-        """Callback for the ``task-received`` event."""
+        """Callback for the :event:`task-received` event."""
         self.received = timestamp
         self.received = timestamp
         self.update(states.RECEIVED, timestamp, fields)
         self.update(states.RECEIVED, timestamp, fields)
 
 
     def on_started(self, timestamp=None, **fields):
     def on_started(self, timestamp=None, **fields):
-        """Callback for the ``task-started`` event."""
+        """Callback for the :event:`task-started` event."""
         self.started = timestamp
         self.started = timestamp
         self.update(states.STARTED, timestamp, fields)
         self.update(states.STARTED, timestamp, fields)
 
 
     def on_failed(self, timestamp=None, **fields):
     def on_failed(self, timestamp=None, **fields):
-        """Callback for the ``task-failed`` event."""
+        """Callback for the :event:`task-failed` event."""
         self.failed = timestamp
         self.failed = timestamp
         self.update(states.FAILURE, timestamp, fields)
         self.update(states.FAILURE, timestamp, fields)
 
 
     def on_retried(self, timestamp=None, **fields):
     def on_retried(self, timestamp=None, **fields):
-        """Callback for the ``task-retried`` event."""
+        """Callback for the :event:`task-retried` event."""
         self.retried = timestamp
         self.retried = timestamp
         self.update(states.RETRY, timestamp, fields)
         self.update(states.RETRY, timestamp, fields)
 
 
     def on_succeeded(self, timestamp=None, **fields):
     def on_succeeded(self, timestamp=None, **fields):
-        """Callback for the ``task-succeeded`` event."""
+        """Callback for the :event:`task-succeeded` event."""
         self.succeeded = timestamp
         self.succeeded = timestamp
         self.update(states.SUCCESS, timestamp, fields)
         self.update(states.SUCCESS, timestamp, fields)
 
 
     def on_revoked(self, timestamp=None, **fields):
     def on_revoked(self, timestamp=None, **fields):
-        """Callback for the ``task-revoked`` event."""
+        """Callback for the :event:`task-revoked` event."""
         self.revoked = timestamp
         self.revoked = timestamp
         self.update(states.REVOKED, timestamp, fields)
         self.update(states.REVOKED, timestamp, fields)
 
 

+ 1 - 1
docs/configuration.rst

@@ -1245,7 +1245,7 @@ CELERY_SEND_TASK_SENT_EVENT
 
 
 .. versionadded:: 2.2
 .. versionadded:: 2.2
 
 
-If enabled, a `task-sent` event will be sent for every task so tasks can be
+If enabled, a :event:`task-sent` event will be sent for every task so tasks can be
 tracked before they are consumed by a worker.
 tracked before they are consumed by a worker.
 
 
 Disabled by default.
 Disabled by default.

+ 2 - 2
docs/history/changelog-1.0.rst

@@ -813,9 +813,9 @@ News
     Excellent for monitoring tools, one is already in the making
     Excellent for monitoring tools, one is already in the making
     (http://github.com/celery/celerymon).
     (http://github.com/celery/celerymon).
 
 
-    Current events include: worker-heartbeat,
+    Current events include: :event:`worker-heartbeat`,
     task-[received/succeeded/failed/retried],
     task-[received/succeeded/failed/retried],
-    worker-online, worker-offline.
+    :event:`worker-online`, :event:`worker-offline`.
 
 
 * You can now delete (revoke) tasks that has already been applied.
 * You can now delete (revoke) tasks that has already been applied.
 
 

+ 1 - 1
docs/history/changelog-2.1.rst

@@ -101,7 +101,7 @@ Documentation
 Fixes
 Fixes
 -----
 -----
 
 
-* celeryd: Now sends the `task-retried` event for retried tasks.
+* celeryd: Now sends the :event:`task-retried` event for retried tasks.
 
 
 * celeryd: Now honors ignore result for
 * celeryd: Now honors ignore result for
   :exc:`~@WorkerLostError` and timeout errors.
   :exc:`~@WorkerLostError` and timeout errors.

+ 1 - 1
docs/history/changelog-2.2.rst

@@ -881,7 +881,7 @@ News
 
 
 
 
 * The PID of the child worker process accepting a task is now sent as a field
 * The PID of the child worker process accepting a task is now sent as a field
-  with the `task-started` event.
+  with the :event:`task-started` event.
 
 
 * The following fields have been added to all events in the worker class:
 * The following fields have been added to all events in the worker class:
 
 

+ 1 - 1
docs/history/changelog-2.3.rst

@@ -100,7 +100,7 @@ Fixes
 * Fixes case where the worker could become unresponsive because of tasks
 * Fixes case where the worker could become unresponsive because of tasks
   exceeding the hard time limit.
   exceeding the hard time limit.
 
 
-* The ``task-sent`` event was missing from the event reference.
+* The :event:`task-sent` event was missing from the event reference.
 
 
 * ``ResultSet.iterate`` now returns results as they finish (Issue #459).
 * ``ResultSet.iterate`` now returns results as they finish (Issue #459).
 
 

+ 2 - 2
docs/whatsnew-3.0.rst

@@ -701,7 +701,7 @@ In Other News
         class Worker(celery.Worker):
         class Worker(celery.Worker):
             ...
             ...
 
 
-- New signal: :signal:`task-success`.
+- New signal: :signal:`task_success`.
 
 
 - Multiprocessing logs are now only emitted if the :envvar:`MP_LOG`
 - Multiprocessing logs are now only emitted if the :envvar:`MP_LOG`
   environment variable is set.
   environment variable is set.
@@ -774,7 +774,7 @@ In Other News
 
 
 - Module ``celery.task.control`` moved to :mod:`celery.app.control`.
 - Module ``celery.task.control`` moved to :mod:`celery.app.control`.
 
 
-- New signal: :signal:`task-revoked`
+- New signal: :signal:`task_revoked`
 
 
     Sent in the main process when the task is revoked or terminated.
     Sent in the main process when the task is revoked or terminated.