protocol.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. =======================
  2. Task Message Protocol
  3. =======================
  4. .. contents::
  5. :local:
  6. Message format
  7. ==============
  8. * task
  9. ``string``
  10. Name of the task. **required**
  11. * id
  12. ``string``
  13. Unique id of the task (UUID). **required**
  14. * args
  15. ``list``
  16. List of arguments. Will be an empty list if not provided.
  17. * kwargs
  18. ``dictionary``
  19. Dictionary of keyword arguments. Will be an empty dictionary if not
  20. provided.
  21. * retries
  22. ``int``
  23. Current number of times this task has been retried.
  24. Defaults to ``0`` if not specified.
  25. * eta
  26. ``string`` (ISO 8601)
  27. Estimated time of arrival. This is the date and time in ISO 8601
  28. format. If not provided the message is not scheduled, but will be
  29. executed asap.
  30. Example message
  31. ===============
  32. This is an example invocation of the ``celery.task.PingTask`` task in JSON
  33. format:
  34. .. code-block:: javascript
  35. {"task": "celery.task.PingTask",
  36. "args": [],
  37. "kwargs": {},
  38. "retries": 0,
  39. "eta": "2009-11-17T12:30:56.527191"}
  40. Serialization
  41. =============
  42. The protocol supports several serialization formats using the
  43. ``content_type`` message header.
  44. The MIME-types supported by default are shown in the following table.
  45. =============== =================================
  46. Scheme MIME Type
  47. =============== =================================
  48. json application/json
  49. yaml application/x-yaml
  50. pickle application/x-python-serialize
  51. msgpack application/x-msgpack
  52. =============== =================================