mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-24 00:00:11 +02:00
Today the Unix and Windows implementations have similar yet differing implementations of hooking into OS events and propagating them to any listening futures. Rather than re-implement the same behavior two different ways, we should factor out any commonality into a shared module and keep the Unix/Windows modules focused solely on OS integrations. Reusing the same implementation across OS versions also allows for more consistent behavior between platforms, which also makes squashing bugs much easier. This change introduces the `registry` module which handles creating and initializing a global map of signals/events and their registered listeners. Each OS specific module is expected to implement the OS hooks which delegate to invoking the registry module's methods for distributing the event notifications. # Use registry module for Windows implementation Note this still uses the same architecture as previously: a driver task is spawned by the first registered event, and that task is responsible for delivering any events to registered futures. (If that first event loop goes away, all events will deadlock). A solution to this issue will be explored at a later time.
48 lines
1.3 KiB
TOML
48 lines
1.3 KiB
TOML
[package]
|
|
name = "tokio-signal"
|
|
# When releasing to crates.io:
|
|
# - Remove path dependencies
|
|
# - Update html_root_url.
|
|
# - Update doc url
|
|
# - Cargo.toml
|
|
# - README.md
|
|
# - Update CHANGELOG.md.
|
|
# - Create "v0.3.x" git tag.
|
|
version = "0.3.0"
|
|
edition = "2018"
|
|
authors = ["Tokio Contributors <[email protected]>"]
|
|
license = "MIT"
|
|
repository = "https://github.com/tokio-rs/tokio"
|
|
homepage = "https://github.com/tokio-rs/tokio"
|
|
documentation = "https://docs.rs/tokio-signal/0.2.8/tokio_signal"
|
|
description = """
|
|
An implementation of an asynchronous Unix signal handling backed futures.
|
|
"""
|
|
categories = ["asynchronous"]
|
|
publish = false
|
|
|
|
[badges]
|
|
travis-ci = { repository = "tokio-rs/tokio" }
|
|
appveyor = { repository = "carllerche/tokio", id = "s83yxhy9qeb58va7" }
|
|
|
|
[dependencies]
|
|
futures = "0.1.11"
|
|
lazy_static = "1"
|
|
tokio-reactor = { version = "0.2.0", path = "../tokio-reactor" }
|
|
tokio-executor = { version = "0.2.0", path = "../tokio-executor" }
|
|
tokio-io = { version = "0.2.0", path = "../tokio-io" }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = "0.2"
|
|
mio = "0.6.14"
|
|
mio-uds = "0.6"
|
|
signal-hook-registry = "~1"
|
|
|
|
[dev-dependencies]
|
|
tokio = { version = "0.2.0", path = "../tokio" }
|
|
tokio-timer = { version = "0.3.0", path = "../tokio-timer" }
|
|
|
|
[target.'cfg(windows)'.dependencies.winapi]
|
|
version = "0.3"
|
|
features = ["consoleapi", "minwindef", "wincon"]
|