Skip to content

How to catch system signals #302

@0b01

Description

@0b01

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

Activity

yoshuawuyts

yoshuawuyts commented on Oct 10, 2019

@yoshuawuyts
Contributor

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.

0b01

0b01 commented on Oct 11, 2019

@0b01
Author

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

Sherlock-Holo commented on Mar 8, 2020

@Sherlock-Holo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    api designOpen design questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @0b01@yoshuawuyts@Sherlock-Holo

        Issue actions

          How to catch system signals · Issue #302 · async-rs/async-std