Skip to content

Commit

Permalink
Adds :event: refs
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Aug 29, 2012
1 parent d8f932f commit 02656d7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
to the logger instead, but you can disable this by changing
Expand All @@ -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.

- 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.

- The worker daemon would try to create the pid file before daemonizing
Expand Down Expand Up @@ -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.

- The ``task-revoked`` event now includes new fields: ``terminated``,
- The :event:`task-revoked` event now includes new fields: ``terminated``,
``signum``, and ``expired``.

- The argument to :class:`~celery.exceptions.TaskRevokedError` is now one
Expand Down Expand Up @@ -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_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.

- Fixes bug with installing on Python 3.
Expand Down
24 changes: 12 additions & 12 deletions celery/events/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ def __init__(self, **fields):
self.heartbeats = []

def on_online(self, timestamp=None, **kwargs):
"""Callback for the `worker-online` event."""
"""Callback for the :event:`worker-online` event."""
self.update(**kwargs)
self._heartpush(timestamp)

def on_offline(self, **kwargs):
"""Callback for the `worker-offline` event."""
"""Callback for the :event:`worker-offline` event."""
self.update(**kwargs)
self.heartbeats = []

def on_heartbeat(self, timestamp=None, **kwargs):
"""Callback for the `worker-heartbeat` event."""
"""Callback for the :event:`worker-heartbeat` event."""
self.update(**kwargs)
self._heartpush(timestamp)

Expand Down Expand Up @@ -93,8 +93,8 @@ class Task(Element):
"""Task State."""

#: 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
#: that state. ``(RECEIVED, ('name', 'args')``, means the name and args
Expand Down Expand Up @@ -147,37 +147,37 @@ def merge(self, state, timestamp, fields):
super(Task, self).update(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.update(states.PENDING, timestamp, 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.update(states.RECEIVED, timestamp, 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.update(states.STARTED, timestamp, 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.update(states.FAILURE, timestamp, 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.update(states.RETRY, timestamp, 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.update(states.SUCCESS, timestamp, 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.update(states.REVOKED, timestamp, fields)

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ CELERY_SEND_TASK_SENT_EVENT

.. 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.

Disabled by default.
Expand Down
4 changes: 2 additions & 2 deletions docs/history/changelog-1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,9 @@ News
Excellent for monitoring tools, one is already in the making
(http://github.com/celery/celerymon).

Current events include: worker-heartbeat,
Current events include: :event:`worker-heartbeat`,
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.

Expand Down
2 changes: 1 addition & 1 deletion docs/history/changelog-2.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Documentation
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
:exc:`~@WorkerLostError` and timeout errors.
Expand Down
2 changes: 1 addition & 1 deletion docs/history/changelog-2.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ News
* 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:
Expand Down
2 changes: 1 addition & 1 deletion docs/history/changelog-2.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Fixes
* Fixes case where the worker could become unresponsive because of tasks
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).

Expand Down
4 changes: 2 additions & 2 deletions docs/whatsnew-3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ In Other News
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`
environment variable is set.
Expand Down Expand Up @@ -774,7 +774,7 @@ In Other News

- 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.

Expand Down

0 comments on commit 02656d7

Please sign in to comment.