API Reference

WSCelery provides a websocket connection under ws://my-domain.com/<task-id>. Once a connection is established the server sends status updates for the task with ID <task-id> to the client.

It is the client’s responsibility to close the connection.

Events

The received events mirror those described in the Celery monitoring reference with some keys excluded. Events are sent through the websocket as JSON and have the following structure:

task-sent

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-sent",
  "name": "myapp.add",
  "retries": 0,
  "eta": 32,
  "routing_key": "default",
  "root_id": 12,
  "parent_id": 15
}

task-received

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-received",
  "timestamp": 1494943644.786262,
  "local_received": 1494947444.446089,
  "utcoffset": -2,
  "retries": 1,
  "root_id": 12,
  "parent_id": 15
}

task-started

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-received",
  "timestamp": 1494943644.786262,
  "local_received": 1494947444.446089,
  "utcoffset": -2
}

task-succeeded

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-succeeded",
  "timestamp": 1494943644.786262,
  "local_received": 1494947444.446089,
  "utcoffset": -2,
  "result": "42",
  "runtime": 5.227228619001835
}

task-failed

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-failed",
  "timestamp": 1494943644.786262,
  "local_received": 1494947444.446089,
  "utcoffset": -2,
  "traceback": "...",
  "exception": "ValueError('oops')",
}

task-rejected

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-rejected",
  "requeued": true,
}

task-revoked

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-revoked",
  "terminated": true,
  "signum": 3,
  "expired": false
}

task-retried

{
  "uuid": "bbef09c9-aff2-4f51-8238-d594fe16bc66",
  "type": "task-retried",
  "timestamp": 1494943644.786262,
  "local_received": 1494947444.446089,
  "utcoffset": -2,
  "exception": "ValueError('oops')",
  "traceback": "...",
}