This document describes an older version of Celery (2.1). For the latest stable version please go here.

Events -, **fields)

Create an event.

An event is a dictionary, the only required field is the type.

class, hostname=None, enabled=True)

Send events as messages.

  • connection – Carrot connection.
  • hostname – Hostname to identify ourselves as, by default uses the hostname returned by socket.gethostname().
  • enabled – Set to False to not actually publish any events, making send() a noop operation.

You need to close() this after use.


Close the event dispatcher.

send(type, **fields)

Send event.

  • type – Kind of event.
  • **fields – Event arguments.
class, handlers=None, wakeup=True)

Capture events.

  • connection – Carrot connection.
  • handlers – Event handlers.

handlers` is a dict of event types and their handlers, the special handler "*`" captures all events that doesn’t have a handler.

capture(limit=None, timeout=None)

Open up a consumer capturing events.

This has to run in the main process, and it will never stop unless forced via KeyboardInterrupt or SystemExit.

handlers = {}
process(type, event)

Process the received event by dispatching it to the appropriate handler., fields)

Previous topic

Contrib: Abortable tasks - celery.contrib.abortable

Next topic

In-memory Representation of Cluster State -

This Page