Set the state of the task to :const:`ABORTED`. Abortable tasks monitor their state at regular intervals and terminate execution if so. Warning: Be aware that invoking this method does not guarantee when the task will be aborted (or even if the task w
(self)
| 112 | return self.state == ABORTED |
| 113 | |
| 114 | def abort(self): |
| 115 | """Set the state of the task to :const:`ABORTED`. |
| 116 | |
| 117 | Abortable tasks monitor their state at regular intervals and |
| 118 | terminate execution if so. |
| 119 | |
| 120 | Warning: |
| 121 | Be aware that invoking this method does not guarantee when the |
| 122 | task will be aborted (or even if the task will be aborted at all). |
| 123 | """ |
| 124 | # TODO: store_result requires all four arguments to be set, |
| 125 | # but only state should be updated here |
| 126 | return self.backend.store_result(self.id, result=None, |
| 127 | state=ABORTED, traceback=None) |
| 128 | |
| 129 | |
| 130 | class AbortableTask(Task): |