-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add msg
to task.cancel()
method to allow distinguish the source of cancellation
#320
Comments
import asyncio class CustomTask(asyncio.Task): def _on_timeout(self, task: "asyncio.Task[None]") -> None: Replace asyncio.Task with CustomTask wherever you want to use itasync def main(): loop = asyncio.get_event_loop() |
How about adding
msg
argument totask.cancel()
?TL;DR:
This would be useful to distinguish the reason of cancellation in library's user programs.
The text was updated successfully, but these errors were encountered: