Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

WIP: Bump tokio to 0.3 and mio to 0.7 #33

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion conch-runtime-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ futures-core = "0.3"
futures-util = "0.3"
tempfile = "3.1"
thiserror = "1"
tokio = { version = "0.2", features = ["full"] }
tokio = { version = "0.3", features = ["full"] }
void = "1"
6 changes: 3 additions & 3 deletions conch-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ futures-util = "0.3"
glob = "0.3"
lazy_static = "1"
thiserror = "1"
tokio = { version = "0.2", features = ["fs", "io-util", "process"] }
tokio = { version = "0.3", features = ["fs", "io-util", "process", "rt"] }
void = "1"

[target.'cfg(unix)'.dependencies]
libc = "0.2"
mio = "0.6"
mio = "0.7"

[target.'cfg(windows)'.dependencies.winapi]
version = "0.3.4"
Expand All @@ -48,7 +48,7 @@ features = [

[dev-dependencies]
owned_chars = "0.3"
tokio = { version = "0.2", features = ["macros"] }
tokio = { version = "0.3", features = ["macros"] }

[badges]
travis-ci = { repository = "ipetkov/conch-runtime" }
Expand Down
2 changes: 1 addition & 1 deletion conch-runtime/src/env/executable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl ExecutableEnvironment for TokioExecEnv {
.map_err(|err| map_io_err(err, name.to_string_lossy().into_owned()))?;

Ok(Box::pin(async move {
child.await.map(ExitStatus::from).unwrap_or(EXIT_ERROR)
child.wait().await.map(ExitStatus::from).unwrap_or(EXIT_ERROR)
}))
}
}
Expand Down
24 changes: 11 additions & 13 deletions conch-runtime/src/sys/unix/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,27 @@ impl From<File> for FileDesc {
}
}

impl mio::Evented for FileDesc {
impl mio::event::Source for FileDesc {
fn register(
&self,
poll: &mio::Poll,
&mut self,
registry: &mio::Registry,
token: mio::Token,
interest: mio::Ready,
opts: mio::PollOpt,
interests: mio::Interest,
) -> Result<()> {
mio::unix::EventedFd(&self.as_raw_fd()).register(poll, token, interest, opts)
mio::unix::SourceFd(&self.as_raw_fd()).register(registry, token, interests)
}

fn reregister(
&self,
poll: &mio::Poll,
&mut self,
registry: &mio::Registry,
token: mio::Token,
interest: mio::Ready,
opts: mio::PollOpt,
interests: mio::Interest,
) -> Result<()> {
mio::unix::EventedFd(&self.as_raw_fd()).reregister(poll, token, interest, opts)
mio::unix::SourceFd(&self.as_raw_fd()).reregister(registry, token, interests)
}

fn deregister(&self, poll: &mio::Poll) -> Result<()> {
mio::unix::EventedFd(&self.as_raw_fd()).deregister(poll)
fn deregister(&mut self, registry: &mio::Registry) -> Result<()> {
mio::unix::SourceFd(&self.as_raw_fd()).deregister(registry)
}
}

Expand Down