-
Notifications
You must be signed in to change notification settings - Fork 3
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
Examine, how to properly cancel 1 task within anyio.TaskGroup #77
Comments
May be related to: From the discussion, it seems, that cancelling just one task within CancelScope may be not the desired behavior within anyio/trio paradigm. However, since a cancellation may be delivered from non-user's code (i.e. calling library, that creates orphan tasks), such calls must be incapsulated with shielding cancel scope by user. This should be mentioned in the docs about websockets. |
The task handler can actually be obtained, by calling task_group._spawn instead of task_group.start_soon, albeit not recommended. There is also a trick with passing an inner cancel_scope outside from task: https://stackoverflow.com/a/60675826 (anyio has same API) |
In websocket endpoint, we should pass task_id from outer scope (on_release), so that user can re-define it and have possibility to call task_group.start instead of task_group.start_soon |
…sy redefinition of on_receive
No description provided.
The text was updated successfully, but these errors were encountered: