Skip to content
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

How to catch system signals #302

Open
0b01 opened this issue Oct 10, 2019 · 3 comments
Open

How to catch system signals #302

0b01 opened this issue Oct 10, 2019 · 3 comments
Labels
api design Open design questions

Comments

@0b01
Copy link

0b01 commented Oct 10, 2019

Is there something similar to tokio_net::signal::unix::Signal?

@yoshuawuyts
Copy link
Contributor

yoshuawuyts commented Oct 10, 2019

Not yet! -- we're aiming for parity with the standard library, so this would be an API we may not want to expose directly from async-std. But I agree we should definitely have a good way of handling signals that's compatible with async-std.

Probably a good way to start would to be to look at signal-hook and see if we can make it compatible with async-std.

@yoshuawuyts yoshuawuyts added the api design Open design questions label Oct 10, 2019
@0b01
Copy link
Author

0b01 commented Oct 11, 2019

Following up on #293. signal-hook crate supports mio by implementing and exposing dyn Evented which in theory could be plugged into a async_std::net::Watcher

@Sherlock-Holo
Copy link

I notice @0b01 you says signal-hook implement Evented, so I try to write a crate async_signals to handle signal in async fn. Also I read the async_std::net::Watcher, it seems is not so hard to add signal into async-std

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api design Open design questions
Projects
None yet
Development

No branches or pull requests

3 participants