Skip to content

Conversation

@benjiwolff
Copy link

@benjiwolff benjiwolff commented May 3, 2025

When a process is started, and a parent task is cancelled, the process is not stopped. Instead the task only ignores the result. This behavior is suboptimal for long-running and expensive processes.

This change

  • adds on_cancel to task: a way to clean up external resources when a task is canceled.
  • uses task and on_cancel in process.run to kill the process when a parent task is cancelled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant