Add cause of cancel cancelation token #5249
Labels
A-tokio-util
Area: The tokio-util crate
C-feature-request
Category: A feature request.
M-sync
Module: tokio/sync
Is your feature request related to a problem? Please describe.
Log reason of token cancelation - it helps with debug process.
Describe the solution you'd like
I want add functions to struct CancellationToken
with causes
cancel_with_cause - allow set cause of cancelation
cancel_cause - check if token cancelled and reason of it.
Describe alternatives you've considered
Additional context
Similar functional will add in standard lib of go1.20:
golang/go#51365
golang/go@5b42f89
The text was updated successfully, but these errors were encountered: