id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tokio-rs/tokio:tokio/src/runtime/time_alt/wheel/mod.rs:6 | let level = level_for(expiration.deadline, deadline);
unsafe {
self.levels[level].add_entry(hdl);
}
} else {
unsafe {
wake_queue.push_front(hdl);
}
}
}
}
fn set_elapsed(&mut s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time_alt/wheel/mod.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/time_alt/wheel/mod.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/runtime/time_alt/wheel/mod.rs:7 | let mut masked = elapsed ^ when | SLOT_MASK;
if masked >= MAX_DURATION {
// Fudge the timer into the top level
masked = MAX_DURATION - 1;
}
let leading_zeros = masked.leading_zeros() as usize;
let significant = 63 - leading_zeros;
significant / NUM_LEVELS
}
#[cfg(all(test, not(lo... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/time_alt/wheel/mod.rs | MIT | 73d733a3415af98d72c2cce40612c4e59adbd5d8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/73d733a3415af98d72c2cce40612c4e59adbd5d8/tokio/src/runtime/time_alt/wheel/mod.rs | 241 | 293 |
tokio-rs/tokio:tokio/src/runtime/timer.rs:1 | pub(crate) use self::variant::*;
#[cfg(feature = "time")]
mod variant {
use crate::runtime::io;
use crate::time::{clock, timer};
pub(crate) type Clock = clock::Clock;
pub(crate) type Driver = timer::Timer<io::Driver>;
pub(crate) type Handle = timer::Handle;
/// Create a new timer driver / han... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/timer.rs | MIT | 7e35922a1d282b1e3dadf037cd237be336b331fb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/7e35922a1d282b1e3dadf037cd237be336b331fb/tokio/src/runtime/timer.rs | 1 | 41 |
tokio-rs/tokio:tokio/src/runtime/timer.rs:1 | pub(crate) use self::variant::*;
#[cfg(feature = "timer")]
mod variant {
use crate::runtime::io;
use crate::timer::{clock, timer};
pub(crate) type Clock = clock::Clock;
pub(crate) type Driver = timer::Timer<io::Driver>;
pub(crate) type Handle = timer::Handle;
/// Create a new timer driver / h... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/runtime/timer.rs | MIT | d5c1119c881c9a8b511aa9000fd26b9bda014256 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d5c1119c881c9a8b511aa9000fd26b9bda014256/tokio/src/runtime/timer.rs | 1 | 41 |
tokio-rs/tokio:tokio/src/signal/ctrl_c.rs:1 | #[cfg(unix)]
use super::unix::{self as os_impl};
#[cfg(windows)]
use super::windows::{self as os_impl};
use std::io;
/// Completes when a "ctrl-c" notification is sent to the process.
///
/// While signals are handled very differently between Unix and Windows, both
/// platforms support receiving a signal on "ctrl-c"... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/ctrl_c.rs | MIT | 8a7e57786a5dca139f5b4261685e22991ded0859 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8a7e57786a5dca139f5b4261685e22991ded0859/tokio/src/signal/ctrl_c.rs | 1 | 35 |
tokio-rs/tokio:tokio/src/signal/mod.rs:2 | //! }
//! }
//! # }
//! ```
use crate::sync::watch::Receiver;
use std::task::{Context, Poll};
#[cfg(feature = "signal")]
mod ctrl_c;
#[cfg(feature = "signal")]
pub use ctrl_c::ctrl_c;
#[cfg(unix)]
pub(crate) mod registry;
pub mod unix;
pub mod windows;
mod reusable_box;
use self::reusable_box::ReusableBoxFuture... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/mod.rs | 41 | 89 |
tokio-rs/tokio:tokio/src/signal/mod.rs:2 | //! }
//! }
//! # }
//! ```
use crate::sync::watch::Receiver;
use std::task::{Context, Poll};
#[cfg(feature = "signal")]
mod ctrl_c;
#[cfg(feature = "signal")]
pub use ctrl_c::ctrl_c;
pub(crate) mod registry;
mod os {
#[cfg(unix)]
pub(crate) use super::unix::{OsExtraData, OsStorage};
#[cfg(windows)]... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | c3b31ba2ab78a901502ff4ac22ec3f2896ab8805 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c3b31ba2ab78a901502ff4ac22ec3f2896ab8805/tokio/src/signal/mod.rs | 41 | 96 |
tokio-rs/tokio:tokio/src/signal/mod.rs:3 | Self {
inner: ReusableBoxFuture::new(make_future(rx)),
}
}
async fn recv(&mut self) {
use std::future::poll_fn;
poll_fn(|cx| self.poll_recv(cx)).await
}
fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<()> {
self.inner
.poll(cx)
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | c3b31ba2ab78a901502ff4ac22ec3f2896ab8805 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c3b31ba2ab78a901502ff4ac22ec3f2896ab8805/tokio/src/signal/mod.rs | 81 | 96 |
tokio-rs/tokio:tokio/src/signal/mod.rs:2 | //! }
//! }
//! # }
//! ```
use crate::sync::watch::Receiver;
use std::task::{Context, Poll};
#[cfg(feature = "signal")]
mod ctrl_c;
#[cfg(feature = "signal")]
pub use ctrl_c::ctrl_c;
pub(crate) mod registry;
mod os {
#[cfg(unix)]
pub(crate) use super::unix::{OsExtraData, OsStorage};
#[cfg(windows)]... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 12b2567b959ec754e6f58fb76b88a1a38f805771 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/12b2567b959ec754e6f58fb76b88a1a38f805771/tokio/src/signal/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/mod.rs:3 | Self {
inner: ReusableBoxFuture::new(make_future(rx)),
}
}
async fn recv(&mut self) -> Option<()> {
use std::future::poll_fn;
poll_fn(|cx| self.poll_recv(cx)).await
}
fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<Option<()>> {
match self.inner.poll(c... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 12b2567b959ec754e6f58fb76b88a1a38f805771 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/12b2567b959ec754e6f58fb76b88a1a38f805771/tokio/src/signal/mod.rs | 81 | 100 |
tokio-rs/tokio:tokio/src/signal/mod.rs:2 | //! }
//! }
//! # }
//! ```
use crate::sync::watch::Receiver;
use std::task::{Context, Poll};
#[cfg(feature = "signal")]
mod ctrl_c;
#[cfg(feature = "signal")]
pub use ctrl_c::ctrl_c;
pub(crate) mod registry;
mod os {
#[cfg(unix)]
pub(crate) use super::unix::{OsExtraData, OsStorage};
#[cfg(windows)]... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 2a0df5fb05ae1a624fe2f6db756190f41812214b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/2a0df5fb05ae1a624fe2f6db756190f41812214b/tokio/src/signal/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/mod.rs:3 | Self {
inner: ReusableBoxFuture::new(make_future(rx)),
}
}
async fn recv(&mut self) -> Option<()> {
use crate::future::poll_fn;
poll_fn(|cx| self.poll_recv(cx)).await
}
fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<Option<()>> {
match self.inner.poll... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 2a0df5fb05ae1a624fe2f6db756190f41812214b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/2a0df5fb05ae1a624fe2f6db756190f41812214b/tokio/src/signal/mod.rs | 81 | 100 |
tokio-rs/tokio:tokio/src/signal/mod.rs:2 | //! }
//! }
//! # }
//! ```
use crate::sync::watch::Receiver;
use std::task::{Context, Poll};
mod ctrl_c;
pub use ctrl_c::ctrl_c;
pub(crate) mod registry;
mod os {
#[cfg(unix)]
pub(crate) use super::unix::{OsExtraData, OsStorage};
#[cfg(windows)]
pub(crate) use super::windows::{OsExtraData, OsSt... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 131e7b4e49c8849298ba54b4e0c99f4b81d869e3 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/131e7b4e49c8849298ba54b4e0c99f4b81d869e3/tokio/src/signal/mod.rs | 41 | 98 |
tokio-rs/tokio:tokio/src/signal/mod.rs:3 | }
}
async fn recv(&mut self) -> Option<()> {
use crate::future::poll_fn;
poll_fn(|cx| self.poll_recv(cx)).await
}
fn poll_recv(&mut self, cx: &mut Context<'_>) -> Poll<Option<()>> {
match self.inner.poll(cx) {
Poll::Pending => Poll::Pending,
Poll::Ready(... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 131e7b4e49c8849298ba54b4e0c99f4b81d869e3 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/131e7b4e49c8849298ba54b4e0c99f4b81d869e3/tokio/src/signal/mod.rs | 81 | 98 |
tokio-rs/tokio:tokio/src/signal/mod.rs:2 | //! }
//! }
//! # }
//! ```
use crate::sync::watch::Receiver;
use std::task::{Context, Poll};
mod ctrl_c;
pub use ctrl_c::ctrl_c;
pub(crate) mod registry;
mod os {
#[cfg(unix)]
pub(crate) use super::unix::{OsExtraData, OsStorage};
#[cfg(windows)]
pub(crate) use super::windows::{OsExtraData, OsSt... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 1ca17bef67677ffcd447f4dce2dd49099fe67e0a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1ca17bef67677ffcd447f4dce2dd49099fe67e0a/tokio/src/signal/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/mod.rs:2 | //! }
//! }
//! # }
//! ```
use crate::sync::watch::Receiver;
use std::task::{Context, Poll};
mod ctrl_c;
pub use ctrl_c::ctrl_c;
mod registry;
mod os {
#[cfg(unix)]
pub(crate) use super::unix::{OsExtraData, OsStorage};
#[cfg(windows)]
pub(crate) use super::windows::{OsExtraData, OsStorage};
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/mod.rs | MIT | 03969cdae7674681d1b10926e6a56fbb8908dbb8 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/03969cdae7674681d1b10926e6a56fbb8908dbb8/tokio/src/signal/mod.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | use crate::signal::unix::{OsExtraData, OsStorage};
use crate::sync::watch;
use std::ops;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::OnceLock;
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery,
/// and what listeners are registered.
#[derive... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f);
}
}
/// Manages and distributes event notifications to any registered listeners.
///
/// Generic over the un... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | if let Some(event_info) = self.storage.event_info(event_id) {
event_info.pending.store(true, Ordering::SeqCst);
}
}
/// Broadcasts all previously recorded events to their respective listeners.
///
/// Returns `true` if an event was delivered to at least one listener.
fn broadcas... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | /// Registers a new listener for `event_id`.
pub(crate) fn register_listener(&self, event_id: EventId) -> watch::Receiver<()> {
self.registry.register_listener(event_id)
}
/// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
pub(crate) fn record_event... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | static GLOBALS: OnceLock<Globals> = OnceLock::new();
GLOBALS.get_or_init(globals_init)
}
#[cfg(all(test, not(loom)))]
mod tests {
use super::*;
use crate::runtime::{self, Runtime};
use crate::sync::{oneshot, watch};
use futures::future;
#[test]
fn smoke() {
let rt = rt();
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | //
// This yields many times since the block_on task is only polled every 61
// ticks.
for _ in 0..100 {
crate::task::yield_now().await;
}
// Send subsequent signal
registry.record_event(0);
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | let registry = Registry::new(vec![EventInfo::default(), EventInfo::default()]);
registry.record_event(0);
assert!(!registry.broadcast());
let first = registry.register_listener(0);
let second = registry.register_listener(1);
registry.record_event(0);
assert!(registry.b... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/c6d58ce7e7bf4a6e7e6efc1ffeb42daa3a627c17/tokio/src/signal/registry.rs | 241 | 275 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use std::ops;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::OnceLock;
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery,
/// and what listeners are registered.
#[derive(D... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 46674789abdcd72189bb48a82c6c2121bc3922a0 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/46674789abdcd72189bb48a82c6c2121bc3922a0/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use std::ops;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::OnceLock;
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery,
/// and what listeners are registered.
#[derive(D... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8507e28f89916662d2f61af823993483169d912c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8507e28f89916662d2f61af823993483169d912c/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f);
}
}
/// An interface for initializing a type. Useful for situations where we cannot
/// inject a configured ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8507e28f89916662d2f61af823993483169d912c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8507e28f89916662d2f61af823993483169d912c/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | .subscribe()
}
/// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
fn record_event(&self, event_id: EventId) {
if let Some(event_info) = self.storage.event_info(event_id) {
event_info.pending.store(true, Ordering::SeqCst);
}
}
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8507e28f89916662d2f61af823993483169d912c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8507e28f89916662d2f61af823993483169d912c/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Registers a new listener for `event_id`.
pub(crate) fn register_listener(&self, event_id: EventId) -> watch::Receiver<()> {
self.registry.register_listener(event_id)
}
/// Marks `event_id` as having been delivere... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8507e28f89916662d2f61af823993483169d912c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8507e28f89916662d2f61af823993483169d912c/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | pub(crate) fn globals() -> &'static Globals
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
static GLOBALS: OnceLock<Globals> = OnceLock::new();
GLOBALS.get_or_init(globals_init)
}
#[cfg(all(test, not(loom)))]
mod tests {
use super::*;
use crate::run... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8507e28f89916662d2f61af823993483169d912c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8507e28f89916662d2f61af823993483169d912c/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.record_event(0);
registry.record_event(1);
registry.record_event(1);
registry.broadcast();
// Yield so the previous broadcast can get received
//
// This yields many times since the block_on task is only polled eve... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8507e28f89916662d2f61af823993483169d912c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8507e28f89916662d2f61af823993483169d912c/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(1302);
}
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default(), EventInfo::default()]);
registry.record_event(0);
assert!(!registry.... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8507e28f89916662d2f61af823993483169d912c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8507e28f89916662d2f61af823993483169d912c/tokio/src/signal/registry.rs | 241 | 281 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use crate::util::once_cell::OnceCell;
use std::ops;
use std::sync::atomic::{AtomicBool, Ordering};
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery,
/// and what listeners are registere... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d4178cf34924d14fca4ecf551c97b8953376f25a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d4178cf34924d14fca4ecf551c97b8953376f25a/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Registers a new listener for `event_id`.
pub(crate) fn register_listener(&self, event_id: EventId) -> watch::Receiver<()> {
self.registry.register_listener(event_id)
}
/// Marks `event_id` as having been delivere... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d4178cf34924d14fca4ecf551c97b8953376f25a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d4178cf34924d14fca4ecf551c97b8953376f25a/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | pub(crate) fn globals() -> &'static Globals
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
static GLOBALS: OnceCell<Globals> = OnceCell::new();
GLOBALS.get(globals_init)
}
#[cfg(all(test, not(loom)))]
mod tests {
use super::*;
use crate::runtime::{s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d4178cf34924d14fca4ecf551c97b8953376f25a | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d4178cf34924d14fca4ecf551c97b8953376f25a/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f);
}
}
/// An interface for initializing a type. Useful for situations where we cannot
/// inject a configured ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 131e7b4e49c8849298ba54b4e0c99f4b81d869e3 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/131e7b4e49c8849298ba54b4e0c99f4b81d869e3/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use crate::util::once_cell::OnceCell;
use std::ops;
use std::sync::atomic::{AtomicBool, Ordering};
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery,
/// and what listeners are registere... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 84c5674c601dfc36ab417ff0ec01763c2dd30a5c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/84c5674c601dfc36ab417ff0ec01763c2dd30a5c/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f);
}
}
/// An interface for initializing a type. Useful for situations where we cannot
/// inject a configured ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 84c5674c601dfc36ab417ff0ec01763c2dd30a5c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/84c5674c601dfc36ab417ff0ec01763c2dd30a5c/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | #![allow(clippy::unit_arg)]
use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use crate::util::once_cell::OnceCell;
use std::ops;
use std::sync::atomic::{AtomicBool, Ordering};
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery,
/// and... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 6871084629ad95c37c7136d865890ab2e371ea12 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/6871084629ad95c37c7136d865890ab2e371ea12/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | impl Storage for Vec<EventInfo> {
fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f);
}
}
/// An interface for initializing a type. Useful for situations wh... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 6871084629ad95c37c7136d865890ab2e371ea12 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/6871084629ad95c37c7136d865890ab2e371ea12/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | .unwrap_or_else(|| panic!("invalid event_id: {}", event_id))
.tx
.subscribe()
}
/// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
fn record_event(&self, event_id: EventId) {
if let Some(event_info) = self.storage.event_info(even... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 6871084629ad95c37c7136d865890ab2e371ea12 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/6871084629ad95c37c7136d865890ab2e371ea12/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | type Target = OsExtraData;
fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Registers a new listener for `event_id`.
pub(crate) fn register_listener(&self, event_id: EventId) -> watch::Receiver<()> {
self.registry.register_listener(event_id)
}
/// Marks `e... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 6871084629ad95c37c7136d865890ab2e371ea12 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/6871084629ad95c37c7136d865890ab2e371ea12/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | }
}
pub(crate) fn globals() -> &'static Globals
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
static GLOBALS: OnceCell<Globals> = OnceCell::new();
GLOBALS.get(globals_init)
}
#[cfg(all(test, not(loom)))]
mod tests {
use super::*;
use crate::runtim... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 6871084629ad95c37c7136d865890ab2e371ea12 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/6871084629ad95c37c7136d865890ab2e371ea12/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | // Record some events which should get coalesced
registry.record_event(0);
registry.record_event(0);
registry.record_event(1);
registry.record_event(1);
registry.broadcast();
// Yield so the previous broadcast can get recei... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 6871084629ad95c37c7136d865890ab2e371ea12 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/6871084629ad95c37c7136d865890ab2e371ea12/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | #[test]
fn record_invalid_event_does_nothing() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(1302);
}
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default(), EventInfo::default()]);
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 6871084629ad95c37c7136d865890ab2e371ea12 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/6871084629ad95c37c7136d865890ab2e371ea12/tokio/src/signal/registry.rs | 241 | 283 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | #![allow(clippy::unit_arg)]
use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use crate::util::once_cell::OnceCell;
use std::ops;
use std::sync::atomic::{AtomicBool, Ordering};
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery,
/// and... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | b9ae7e6659f31508fbe81e29508984d0c6f2d0b4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b9ae7e6659f31508fbe81e29508984d0c6f2d0b4/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | impl Storage for Vec<EventInfo> {
fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f)
}
}
/// An interface for initializing a type. Useful for situations whe... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | b9ae7e6659f31508fbe81e29508984d0c6f2d0b4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b9ae7e6659f31508fbe81e29508984d0c6f2d0b4/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | .unwrap_or_else(|| panic!("invalid event_id: {}", event_id))
.tx
.subscribe()
}
/// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
fn record_event(&self, event_id: EventId) {
if let Some(event_info) = self.storage.event_info(even... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | b9ae7e6659f31508fbe81e29508984d0c6f2d0b4 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/b9ae7e6659f31508fbe81e29508984d0c6f2d0b4/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | #![allow(clippy::unit_arg)]
use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use crate::util::once_cell::OnceCell;
use std::ops;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pendin... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 05e661490b87a3d60a8342535bdc9d213048519c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/05e661490b87a3d60a8342535bdc9d213048519c/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | }
impl Storage for Vec<EventInfo> {
fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f)
}
}
/// An interface for initializing a type. Useful for situations ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 05e661490b87a3d60a8342535bdc9d213048519c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/05e661490b87a3d60a8342535bdc9d213048519c/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | .event_info(event_id)
.unwrap_or_else(|| panic!("invalid event_id: {}", event_id))
.tx
.subscribe()
}
/// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
fn record_event(&self, event_id: EventId) {
if let Some(event_in... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 05e661490b87a3d60a8342535bdc9d213048519c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/05e661490b87a3d60a8342535bdc9d213048519c/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | impl ops::Deref for Globals {
type Target = OsExtraData;
fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Registers a new listener for `event_id`.
pub(crate) fn register_listener(&self, event_id: EventId) -> watch::Receiver<()> {
self.registry.register_listener... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 05e661490b87a3d60a8342535bdc9d213048519c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/05e661490b87a3d60a8342535bdc9d213048519c/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | registry: Registry::new(OsStorage::init()),
}
}
pub(crate) fn globals() -> Pin<&'static Globals>
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
static GLOBALS: OnceCell<Globals> = OnceCell::new();
Pin::new(GLOBALS.get(globals_init))
}
#[cfg(all(test, n... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 05e661490b87a3d60a8342535bdc9d213048519c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/05e661490b87a3d60a8342535bdc9d213048519c/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | // Record some events which should get coalesced
registry.record_event(0);
registry.record_event(0);
registry.record_event(1);
registry.record_event(1);
registry.broadcast();
// Yield so the previous broadcast can get recei... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 05e661490b87a3d60a8342535bdc9d213048519c | github | async-runtime | https://github.com/tokio-rs/tokio/blob/05e661490b87a3d60a8342535bdc9d213048519c/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | #![allow(clippy::unit_arg)]
use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::watch;
use once_cell::sync::Lazy;
use std::ops;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending delivery... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e8ae65a697d04aa11d5587c45caf999cb3b7f36e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e8ae65a697d04aa11d5587c45caf999cb3b7f36e/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | F: FnMut(&'a EventInfo);
}
impl Storage for Vec<EventInfo> {
fn event_info(&self, id: EventId) -> Option<&EventInfo> {
self.get(id)
}
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo),
{
self.iter().for_each(f)
}
}
/// An interface for initializing a typ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e8ae65a697d04aa11d5587c45caf999cb3b7f36e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e8ae65a697d04aa11d5587c45caf999cb3b7f36e/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | self.storage
.event_info(event_id)
.unwrap_or_else(|| panic!("invalid event_id: {}", event_id))
.tx
.subscribe()
}
/// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
fn record_event(&self, event_id: EventId) {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e8ae65a697d04aa11d5587c45caf999cb3b7f36e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e8ae65a697d04aa11d5587c45caf999cb3b7f36e/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | impl ops::Deref for Globals {
type Target = OsExtraData;
fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Registers a new listener for `event_id`.
pub(crate) fn register_listener(&self, event_id: EventId) -> watch::Receiver<()> {
self.registry.register_listener... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e8ae65a697d04aa11d5587c45caf999cb3b7f36e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e8ae65a697d04aa11d5587c45caf999cb3b7f36e/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | Box::pin(Globals {
extra: OsExtraData::init(),
registry: Registry::new(OsStorage::init()),
})
});
GLOBALS.as_ref()
}
#[cfg(all(test, not(loom)))]
mod tests {
use super::*;
use crate::runtime::{self, Runtime};
use crate::sync::{oneshot, watch};
use futures::futu... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e8ae65a697d04aa11d5587c45caf999cb3b7f36e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e8ae65a697d04aa11d5587c45caf999cb3b7f36e/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.record_event(1);
registry.broadcast();
// Yield so the previous broadcast can get received
//
// This yields many times since the block_on task is only polled every 61
// ticks.
for _ in 0..100 {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e8ae65a697d04aa11d5587c45caf999cb3b7f36e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e8ae65a697d04aa11d5587c45caf999cb3b7f36e/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | }
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default(), EventInfo::default()]);
registry.record_event(0);
assert!(!registry.broadcast());
let first = registry.register_listener(0);
let second = registry.reg... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e8ae65a697d04aa11d5587c45caf999cb3b7f36e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e8ae65a697d04aa11d5587c45caf999cb3b7f36e/tokio/src/signal/registry.rs | 241 | 279 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.record_event(1);
registry.broadcast();
// Yield so the previous broadcast can get received
//
// This yields many times since the block_on task is only polled every 61
// ticks.
for _ in 0..100 {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 1be8e9dfb7b1140568ac10ac34f5f8171a89e40d | github | async-runtime | https://github.com/tokio-rs/tokio/blob/1be8e9dfb7b1140568ac10ac34f5f8171a89e40d/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | Box::pin(Globals {
extra: OsExtraData::init(),
registry: Registry::new(OsStorage::init()),
})
});
GLOBALS.as_ref()
}
#[cfg(all(test, not(loom)))]
mod tests {
use super::*;
use crate::runtime::{self, Runtime};
use crate::sync::{oneshot, watch};
use futures::futu... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8198ef38814c45f9dc02fcbf826225b5cf32a6bb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8198ef38814c45f9dc02fcbf826225b5cf32a6bb/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.record_event(1);
registry.broadcast();
// Yield so the previous broadcast can get received
crate::time::sleep(std::time::Duration::from_millis(10)).await;
// Send subsequent signal
registry.record_event(0);
regist... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8198ef38814c45f9dc02fcbf826225b5cf32a6bb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8198ef38814c45f9dc02fcbf826225b5cf32a6bb/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | registry.record_event(0);
assert!(!registry.broadcast());
let first = registry.register_listener(0);
let second = registry.register_listener(1);
registry.record_event(0);
assert!(registry.broadcast());
drop(first);
registry.record_event(0);
assert!(!reg... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8198ef38814c45f9dc02fcbf826225b5cf32a6bb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8198ef38814c45f9dc02fcbf826225b5cf32a6bb/tokio/src/signal/registry.rs | 241 | 274 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.record_event(1);
registry.broadcast();
// Yield so the previous broadcast can get received
crate::time::sleep(std::time::Duration::from_millis(10)).await;
// Send subsequent signal
registry.record_event(0);
regist... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e4f76688a00fa2ce81ab6c074700995095c29e1e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e4f76688a00fa2ce81ab6c074700995095c29e1e/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | registry.record_event(0);
assert_eq!(false, registry.broadcast());
let first = registry.register_listener(0);
let second = registry.register_listener(1);
registry.record_event(0);
assert_eq!(true, registry.broadcast());
drop(first);
registry.record_event(0);
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | e4f76688a00fa2ce81ab6c074700995095c29e1e | github | async-runtime | https://github.com/tokio-rs/tokio/blob/e4f76688a00fa2ce81ab6c074700995095c29e1e/tokio/src/signal/registry.rs | 241 | 274 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | #![allow(clippy::unit_arg)]
use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::mpsc::Sender;
use once_cell::sync::Lazy;
use std::ops;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Mutex;
pub(crate) type EventId = usize;
/// State for a specific event, whether a not... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | F: FnMut(&'a EventInfo),
{
self.iter().for_each(f)
}
}
/// An interface for initializing a type. Useful for situations where we cannot
/// inject a configured instance in the constructor of another type.
pub(crate) trait Init {
fn init() -> Self;
}
/// Manages and distributes event notifications t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | /// any listeners.
fn record_event(&self, event_id: EventId) {
if let Some(event_info) = self.storage.event_info(event_id) {
event_info.pending.store(true, Ordering::SeqCst)
}
}
/// Broadcasts all previously recorded events to their respective listeners.
///
/// Returns ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | did_notify
}
}
pub(crate) struct Globals {
extra: OsExtraData,
registry: Registry<OsStorage>,
}
impl ops::Deref for Globals {
type Target = OsExtraData;
fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Registers a new listener for `event_id`.
pub(crate) f... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | }
pub(crate) fn globals() -> Pin<&'static Globals>
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
static GLOBALS: Lazy<Pin<Box<Globals>>> = Lazy::new(|| {
Box::pin(Globals {
extra: OsExtraData::init(),
registry: Registry::new(OsSt... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.register_listener(1, second_tx);
registry.register_listener(2, third_tx);
let (fire, wait) = oneshot::channel();
crate::spawn(async {
wait.await.expect("wait failed");
// Record some events which should get coalesced
registr... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | #[test]
fn record_invalid_event_does_nothing() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(42);
}
#[test]
fn broadcast_cleans_up_disconnected_listeners() {
let rt = Runtime::new().unwrap();
rt.block_on(async {
let regist... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/signal/registry.rs:8 | assert_eq!(1, results.len());
});
}
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(0);
assert_eq!(false, registry.broadcast());
let (first_tx, first_rx) = mpsc::channel(1)... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 0dbba139848de6a8ee88350cc7fc48d0b05016c5 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/0dbba139848de6a8ee88350cc7fc48d0b05016c5/tokio/src/signal/registry.rs | 281 | 321 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | #![allow(clippy::unit_arg)]
use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::mpsc::Sender;
use lazy_static::lazy_static;
use std::ops;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Mutex;
pub(crate) type EventId = usize;
/// State for a specific event, whether a ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | did_notify
}
}
pub(crate) struct Globals {
extra: OsExtraData,
registry: Registry<OsStorage>,
}
impl ops::Deref for Globals {
type Target = OsExtraData;
fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Registers a new listener for `event_id`.
pub(crate) f... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | }
pub(crate) fn globals() -> Pin<&'static Globals>
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
lazy_static! {
static ref GLOBALS: Pin<Box<Globals>> = Box::pin(Globals {
extra: OsExtraData::init(),
registry: Registry::new(OsStor... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8880222036f37c6204c8466f25e828447f16dacb | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8880222036f37c6204c8466f25e828447f16dacb/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:8 | assert_eq!(1, results.len());
});
}
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(0);
assert_eq!(false, registry.broadcast());
let (first_tx, first_rx) = mpsc::channel(1)... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d600ab9a8f37e9eff3fa8587069a816b65b6da0b | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d600ab9a8f37e9eff3fa8587069a816b65b6da0b/tokio/src/signal/registry.rs | 281 | 321 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | }
pub(crate) fn globals() -> Pin<&'static Globals>
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
lazy_static! {
static ref GLOBALS: Pin<Box<Globals>> = Box::pin(Globals {
extra: OsExtraData::init(),
registry: Registry::new(OsStor... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | f9ddb93604a830d106475bd4c4cae436fafcc0da | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.register_listener(1, second_tx);
registry.register_listener(2, third_tx);
let (fire, wait) = oneshot::channel();
crate::spawn(async {
wait.await.expect("wait failed");
// Record some events which should get coalesced
registr... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | f9ddb93604a830d106475bd4c4cae436fafcc0da | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | #[test]
fn record_invalid_event_does_nothing() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(42);
}
#[test]
fn broadcast_cleans_up_disconnected_listeners() {
let mut rt = Runtime::new().unwrap();
rt.block_on(async {
let re... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | f9ddb93604a830d106475bd4c4cae436fafcc0da | github | async-runtime | https://github.com/tokio-rs/tokio/blob/f9ddb93604a830d106475bd4c4cae436fafcc0da/tokio/src/signal/registry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | #![allow(clippy::unit_arg)]
use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::mpsc::Sender;
use lazy_static::lazy_static;
use std::ops;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Mutex;
pub(crate) type EventId = usize;
/// State for a specific event, whether a ... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d593c5b051f07bde5117122216a356632986b6dd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | F: FnMut(&'a EventInfo),
{
self.iter().for_each(f)
}
}
/// An interface for initializing a type. Useful for situations where we cannot
/// inject a configured instance in the constructor of another type.
pub(crate) trait Init {
fn init() -> Self;
}
/// Manages and distributes event notifications t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d593c5b051f07bde5117122216a356632986b6dd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | /// any listeners.
fn record_event(&self, event_id: EventId) {
if let Some(event_info) = self.storage.event_info(event_id) {
event_info.pending.store(true, Ordering::SeqCst)
}
}
/// Broadcast all previously recorded events to their respective listeners.
///
/// Returns t... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d593c5b051f07bde5117122216a356632986b6dd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | did_notify
}
}
pub(crate) struct Globals {
extra: OsExtraData,
registry: Registry<OsStorage>,
}
impl ops::Deref for Globals {
type Target = OsExtraData;
fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Register a new listener for `event_id`.
pub(crate) fn... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d593c5b051f07bde5117122216a356632986b6dd | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d593c5b051f07bde5117122216a356632986b6dd/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:1 | use crate::signal::os::{OsExtraData, OsStorage};
use crate::sync::mpsc::Sender;
use lazy_static::lazy_static;
use std::ops;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Mutex;
pub(crate) type EventId = usize;
/// State for a specific event, whether a notification is pending deliv... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 1 | 60 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | self.iter().for_each(f)
}
}
/// An interface for initializing a type. Useful for situations where we cannot
/// inject a configured instance in the constructor of another type.
pub(crate) trait Init {
fn init() -> Self;
}
/// Manages and distributes event notifications to any registered listeners.
///
/// Gen... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | if let Some(event_info) = self.storage.event_info(event_id) {
event_info.pending.store(true, Ordering::SeqCst)
}
}
/// Broadcast all previously recorded events to their respective listeners.
///
/// Returns true if an event was delivered to at least one listener.
fn broadcast(&s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:4 | }
pub(crate) struct Globals {
extra: OsExtraData,
registry: Registry<OsStorage>,
}
impl ops::Deref for Globals {
type Target = OsExtraData;
fn deref(&self) -> &Self::Target {
&self.extra
}
}
impl Globals {
/// Register a new listener for `event_id`.
pub(crate) fn register_listene... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 121 | 180 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | pub(crate) fn globals() -> Pin<&'static Globals>
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
lazy_static! {
static ref GLOBALS: Pin<Box<Globals>> = Box::pin(Globals {
extra: OsExtraData::init(),
registry: Registry::new(OsStorage... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | let (fire, wait) = oneshot::channel();
crate::spawn(async {
wait.await.expect("wait failed");
// Record some events which should get coalesced
registry.record_event(0);
registry.record_event(0);
registry.record_event(1);
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | fn record_invalid_event_does_nothing() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(42);
}
#[test]
fn broadcast_cleans_up_disconnected_listeners() {
let mut rt = Runtime::new().unwrap();
rt.block_on(async {
let registry = Reg... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/signal/registry.rs:8 | }
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(0);
assert_eq!(false, registry.broadcast());
let (first_tx, first_rx) = mpsc::channel(1);
let (second_tx, second_rx) = mpsc::c... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 3f0eabe7798de624f5ee9c7562803bfb97e6088f | github | async-runtime | https://github.com/tokio-rs/tokio/blob/3f0eabe7798de624f5ee9c7562803bfb97e6088f/tokio/src/signal/registry.rs | 281 | 319 |
tokio-rs/tokio:tokio/src/signal/registry.rs:8 | }
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(0);
assert_eq!(false, registry.broadcast());
let (first_tx, first_rx) = mpsc::channel(1);
let (second_tx, second_rx) = mpsc::c... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | 8a7e57786a5dca139f5b4261685e22991ded0859 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/8a7e57786a5dca139f5b4261685e22991ded0859/tokio/src/signal/registry.rs | 281 | 319 |
tokio-rs/tokio:tokio/src/signal/registry.rs:2 | self.iter().for_each(f)
}
}
/// An interface for initializing a type. Useful for situations where we cannot
/// inject a configured instance in the constructor of another type.
pub(crate) trait Init {
fn init() -> Self;
}
/// Manages and distributes event notifications to any registered listeners.
///
/// Gen... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d70c928d88dff9e3e8d673b8ee02bce131598550 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d70c928d88dff9e3e8d673b8ee02bce131598550/tokio/src/signal/registry.rs | 41 | 100 |
tokio-rs/tokio:tokio/src/signal/registry.rs:3 | if let Some(event_info) = self.storage.event_info(event_id) {
event_info.pending.store(true, Ordering::SeqCst)
}
}
/// Broadcast all previously recorded events to their respective listeners.
///
/// Returns true if an event was delivered to at least one listener.
fn broadcast(&s... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d70c928d88dff9e3e8d673b8ee02bce131598550 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d70c928d88dff9e3e8d673b8ee02bce131598550/tokio/src/signal/registry.rs | 81 | 140 |
tokio-rs/tokio:tokio/src/signal/registry.rs:5 | }
pub(crate) fn globals() -> Pin<&'static Globals>
where
OsExtraData: 'static + Send + Sync + Init,
OsStorage: 'static + Send + Sync + Init,
{
lazy_static! {
static ref GLOBALS: Pin<Box<Globals>> = Box::pin(Globals {
extra: OsExtraData::init(),
registry: Registry::new(OsStor... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d70c928d88dff9e3e8d673b8ee02bce131598550 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d70c928d88dff9e3e8d673b8ee02bce131598550/tokio/src/signal/registry.rs | 161 | 220 |
tokio-rs/tokio:tokio/src/signal/registry.rs:6 | registry.register_listener(2, third_tx);
let (fire, wait) = oneshot::channel();
crate::spawn(async {
wait.await.expect("wait failed");
// Record some events which should get coalesced
registry.record_event(0);
registry.record_eve... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d70c928d88dff9e3e8d673b8ee02bce131598550 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d70c928d88dff9e3e8d673b8ee02bce131598550/tokio/src/signal/registry.rs | 201 | 260 |
tokio-rs/tokio:tokio/src/signal/registry.rs:7 | let (tx, _) = mpsc::channel(1);
registry.register_listener(1, tx);
}
#[test]
fn record_invalid_event_does_nothing() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(42);
}
#[test]
fn broadcast_cleans_up_disconnected_listeners() {
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d70c928d88dff9e3e8d673b8ee02bce131598550 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d70c928d88dff9e3e8d673b8ee02bce131598550/tokio/src/signal/registry.rs | 241 | 300 |
tokio-rs/tokio:tokio/src/signal/registry.rs:8 | let _ = fire.send(());
let results: Vec<()> = third_rx.collect().await;
assert_eq!(1, results.len());
});
}
#[test]
fn broadcast_returns_if_at_least_one_event_fired() {
let registry = Registry::new(vec![EventInfo::default()]);
registry.record_event(0);
... | rust | rust | rust-source | tokio-rs/tokio | tokio/src/signal/registry.rs | MIT | d70c928d88dff9e3e8d673b8ee02bce131598550 | github | async-runtime | https://github.com/tokio-rs/tokio/blob/d70c928d88dff9e3e8d673b8ee02bce131598550/tokio/src/signal/registry.rs | 281 | 314 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.