protocol.rst 1.5 KB

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