Create a new Task with modified defaults.
(
self,
*,
priority=None,
queue_name=None,
run_after=None,
backend=None,
)
| 77 | return self.func.__name__ |
| 78 | |
| 79 | def using( |
| 80 | self, |
| 81 | *, |
| 82 | priority=None, |
| 83 | queue_name=None, |
| 84 | run_after=None, |
| 85 | backend=None, |
| 86 | ): |
| 87 | """Create a new Task with modified defaults.""" |
| 88 | |
| 89 | changes = {} |
| 90 | if priority is not None: |
| 91 | changes["priority"] = priority |
| 92 | if queue_name is not None: |
| 93 | changes["queue_name"] = queue_name |
| 94 | if run_after is not None: |
| 95 | changes["run_after"] = run_after |
| 96 | if backend is not None: |
| 97 | changes["backend"] = backend |
| 98 | return replace(self, **changes) |
| 99 | |
| 100 | def enqueue(self, *args, **kwargs): |
| 101 | """Queue up the Task to be executed.""" |