mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
process: Rename EventedReaper to Reaper
This commit is contained in:
parent
42d0f53ddb
commit
8a1777b800
@ -32,7 +32,7 @@ use mio::unix::{EventedFd, UnixReady};
|
|||||||
use mio::{PollOpt, Ready, Token};
|
use mio::{PollOpt, Ready, Token};
|
||||||
use mio::event::Evented;
|
use mio::event::Evented;
|
||||||
use mio;
|
use mio;
|
||||||
use self::reap::{EventedReaper, Kill, Wait};
|
use self::reap::{Kill, Reaper, Wait};
|
||||||
use self::tokio_signal::unix::Signal;
|
use self::tokio_signal::unix::Signal;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io;
|
use std::io;
|
||||||
@ -55,7 +55,7 @@ impl Kill for process::Child {
|
|||||||
|
|
||||||
#[must_use = "futures do nothing unless polled"]
|
#[must_use = "futures do nothing unless polled"]
|
||||||
pub struct Child {
|
pub struct Child {
|
||||||
inner: EventedReaper<process::Child, FlattenStream<IoFuture<Signal>>>,
|
inner: Reaper<process::Child, FlattenStream<IoFuture<Signal>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for Child {
|
impl fmt::Debug for Child {
|
||||||
@ -76,7 +76,7 @@ impl Child {
|
|||||||
|
|
||||||
let signal = Signal::with_handle(libc::SIGCHLD, handle).flatten_stream();
|
let signal = Signal::with_handle(libc::SIGCHLD, handle).flatten_stream();
|
||||||
let child = Child {
|
let child = Child {
|
||||||
inner: EventedReaper::new(inner, signal),
|
inner: Reaper::new(inner, signal),
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok((child, stdin, stdout, stderr))
|
Ok((child, stdin, stdout, stderr))
|
||||||
|
@ -18,12 +18,12 @@ pub trait Kill {
|
|||||||
/// Orchestrates between registering interest for receiving signals when a
|
/// Orchestrates between registering interest for receiving signals when a
|
||||||
/// child process has exited, and attempting to poll for process completion.
|
/// child process has exited, and attempting to poll for process completion.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct EventedReaper<W, S> {
|
pub struct Reaper<W, S> {
|
||||||
inner: W,
|
inner: W,
|
||||||
signal: S,
|
signal: S,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<W, S> Deref for EventedReaper<W, S> {
|
impl<W, S> Deref for Reaper<W, S> {
|
||||||
type Target = W;
|
type Target = W;
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
@ -31,7 +31,7 @@ impl<W, S> Deref for EventedReaper<W, S> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<W, S> EventedReaper<W, S> {
|
impl<W, S> Reaper<W, S> {
|
||||||
pub fn new(inner: W, signal: S) -> Self {
|
pub fn new(inner: W, signal: S) -> Self {
|
||||||
Self {
|
Self {
|
||||||
inner,
|
inner,
|
||||||
@ -40,7 +40,7 @@ impl<W, S> EventedReaper<W, S> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<W, S> Future for EventedReaper<W, S>
|
impl<W, S> Future for Reaper<W, S>
|
||||||
where W: Wait,
|
where W: Wait,
|
||||||
S: Stream<Error = io::Error>,
|
S: Stream<Error = io::Error>,
|
||||||
{
|
{
|
||||||
@ -88,7 +88,7 @@ impl<W, S> Future for EventedReaper<W, S>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<W, S> Kill for EventedReaper<W, S>
|
impl<W, S> Kill for Reaper<W, S>
|
||||||
where W: Kill,
|
where W: Kill,
|
||||||
{
|
{
|
||||||
fn kill(&mut self) -> io::Result<()> {
|
fn kill(&mut self) -> io::Result<()> {
|
||||||
@ -169,10 +169,10 @@ mod test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn evented_reaper() {
|
fn reaper() {
|
||||||
let exit = ExitStatus::from_raw(0);
|
let exit = ExitStatus::from_raw(0);
|
||||||
let mock = MockWait::new(exit.clone(), 3);
|
let mock = MockWait::new(exit.clone(), 3);
|
||||||
let mut grim = EventedReaper::new(mock, MockStream::new(vec!(
|
let mut grim = Reaper::new(mock, MockStream::new(vec!(
|
||||||
None,
|
None,
|
||||||
Some(()),
|
Some(()),
|
||||||
None,
|
None,
|
||||||
@ -200,7 +200,7 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
fn kill() {
|
fn kill() {
|
||||||
let exit = ExitStatus::from_raw(0);
|
let exit = ExitStatus::from_raw(0);
|
||||||
let mut grim = EventedReaper::new(
|
let mut grim = Reaper::new(
|
||||||
MockWait::new(exit, 0),
|
MockWait::new(exit, 0),
|
||||||
MockStream::new(vec!(None))
|
MockStream::new(vec!(None))
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user