signals.py 1.3 KB

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