celery.signals.rst 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ========================================
  2. Signals - celery.signals
  3. ========================================
  4. .. contents::
  5. :local:
  6. .. currentmodule:: celery.signals
  7. .. data:: task_sent
  8. Triggered when a task has been sent to the broker.
  9. Note that this is executed in the client process, the one sending
  10. the task, not in the worker.
  11. Provides arguments:
  12. * task_id
  13. Id of the task to be executed.
  14. * task
  15. The task being executed.
  16. * args
  17. the tasks positional arguments.
  18. * kwargs
  19. The tasks keyword arguments.
  20. * eta
  21. The time to execute the task.
  22. * taskset
  23. Id of the taskset this task is part of (if any).
  24. .. data:: task_prerun
  25. Triggered before a task is executed.
  26. Provides arguments:
  27. * task_id
  28. Id of the task to be executed.
  29. * task
  30. The task being executed.
  31. * args
  32. the tasks positional arguments.
  33. * kwargs
  34. The tasks keyword arguments.
  35. .. data:: task_postrun
  36. Triggered after a task has been executed.
  37. Provides arguments:
  38. * task_id
  39. Id of the task to be executed.
  40. * task
  41. The task being executed.
  42. * args
  43. The tasks positional arguments.
  44. * kwargs
  45. The tasks keyword arguments.
  46. * retval
  47. The return value of the task.
  48. .. data:: worker_init
  49. Triggered before the worker is started.
  50. .. data:: worker_ready
  51. Triggered when the worker is ready to accept work.
  52. .. data:: worker_shutdown
  53. Triggered when the worker is about to shut down.