signals.py 820 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. from django.dispatch import Signal
  2. """
  3. .. DATA: task_prerun
  4. Triggered before a task is executed.
  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. """
  15. task_prerun = Signal(providing_args=[
  16. "task_id", "task", "args", "kwargs"])
  17. """
  18. .. DATA: task_postrun
  19. Triggered after a task has been executed.
  20. Provides arguments:
  21. * task_id
  22. Id of the task to be executed.
  23. * task
  24. The task being executed.
  25. * args
  26. the tasks positional arguments.
  27. * kwargs
  28. The tasks keyword arguments.
  29. * retval
  30. The return value of the task.
  31. """
  32. task_postrun = Signal(providing_args=[
  33. "task_id", "task", "args", "kwargs", "retval"])