We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How to run the listener in a thread and be able to cancel it some time later?
I tried to use tokio join handle's abort() method but doesn't work.
abort()
I am on Mac and in the source code I saw that native APIs were used instead of rust loop, I guess that's why abort() won't work.
Is there any way to do that?
use rdev::{listen, Event}; fn callback(event: Event) { println!("My callback {:?}", event); } #[tokio::main] async fn main() { let join_handle = tokio::spawn(async move { if let Err(error) = listen(callback) { println!("Error: {:?}", error) } }); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; println!("aborting join handle "); join_handle.abort(); println!("aborted"); tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; }
The text was updated successfully, but these errors were encountered:
See here(#72) for more details
Sorry, something went wrong.
#137
I pushed some code to provide stop_listen function on macos~
No branches or pull requests
How to run the listener in a thread and be able to cancel it some time later?
I tried to use tokio join handle's
abort()
method but doesn't work.I am on Mac and in the source code I saw that native APIs were used instead of rust loop, I guess that's why
abort()
won't work.Is there any way to do that?
The text was updated successfully, but these errors were encountered: