signals.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. from django.dispatch import Signal
  2. """
  3. .. data:: task_sent
  4. Triggered when a task has been sent to the broker.
  5. Please note that this is executed in the client, the process sending
  6. the task, not in the worker.
  7. Provides arguments:
  8. * task_id
  9. Id of the task to be executed.
  10. * task
  11. The task being executed.
  12. * args
  13. the tasks positional arguments.
  14. * kwargs
  15. The tasks keyword arguments.
  16. * eta
  17. The time to execute the task.
  18. * taskset
  19. Id of the taskset this task is part of (if any).
  20. """
  21. task_sent = Signal(providing_args=[
  22. "task_id", "task", "args", "kwargs", "eta",
  23. "taskset"])
  24. """
  25. .. data:: task_prerun
  26. Triggered before a task is executed.
  27. Provides arguments:
  28. * task_id
  29. Id of the task to be executed.
  30. * task
  31. The task being executed.
  32. * args
  33. the tasks positional arguments.
  34. * kwargs
  35. The tasks keyword arguments.
  36. """
  37. task_prerun = Signal(providing_args=[
  38. "task_id", "task", "args", "kwargs"])
  39. """
  40. .. data:: task_postrun
  41. Triggered after a task has been executed.
  42. Provides arguments:
  43. * task_id
  44. Id of the task to be executed.
  45. * task
  46. The task being executed.
  47. * args
  48. the tasks positional arguments.
  49. * kwargs
  50. The tasks keyword arguments.
  51. * retval
  52. The return value of the task.
  53. """
  54. task_postrun = Signal(providing_args=[
  55. "task_id", "task", "args", "kwargs", "retval"])