Currently, the baserunner handles context cancellation, but the only task it can currently interrupt is WaitTask, which it does by calling private methods (eww).
As a user who uses the global context for cancellation/timeout, I want to be able to interrupt the applier/destoryer and have it exit quickly, without finishing the ApplyTask/PruneTask.
Solution:
- Pass context to tasks by adding it to the TaskContext
- Update all tasks to handle context.Done() and exit early
- Update all tasks to pass the context to all network calls, so they also can be cancelled (most already take a context)
- Add a Task method to handle status events, so WaitTask can exit early.
Currently, the baserunner handles context cancellation, but the only task it can currently interrupt is WaitTask, which it does by calling private methods (eww).
As a user who uses the global context for cancellation/timeout, I want to be able to interrupt the applier/destoryer and have it exit quickly, without finishing the ApplyTask/PruneTask.
Solution: