-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Feature] Access to Abort Signal from Client #2219
Comments
Is the actual signal needed? I try to present a unified API in reqwest, without exposing internals. The signal is used to make the Can you do what you want without direct access? |
Ah, I think we may be able to use // Asynchronous loop to continuously check for cancellation signal
loop {
tokio::select! {
_ = sleep(Duration::from_secs(1)) => {
println!("Async task running...");
}
_ = cancel_receiver.recv() => {
println!("Cancellation signal received. Dropping task...");
break; // Break out of the loop when cancellation signal is received
}
}
} |
I believe that should do it. |
I would like to have access to Abort Signal from the client implementation. We need access to it for some existing functionality we are looking to replace with reqwest.
cloudflare/workers-rs#510 (comment)
The text was updated successfully, but these errors were encountered: