Skip to content

Commit

Permalink
Use AsyncFd::with_interest
Browse files Browse the repository at this point in the history
  • Loading branch information
DoumanAsh committed Dec 1, 2020
1 parent 683948a commit 0775bf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ features = ["threadpoolapiset"]
libc = { version = "0.2.60", default-features = false }
mio = { version = "0.6", optional = true }
tokio_02 = { package = "tokio", version = "0.2", default-features = false, optional = true, features = ["io-driver"] }
tokio_03 = { package = "tokio", version = "0.3.2", default-features = false, optional = true, features = ["net"] }
tokio_03 = { package = "tokio", version = "0.3.5", default-features = false, optional = true, features = ["net"] }

#kqueue needs nix
[target.'cfg(any(target_os = "bitrig", target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/timer/async_tokio03.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl<T: TimerFd> Future for AsyncTokioTimer<T> {

fn poll(mut self: Pin<&mut Self>, ctx: &mut task::Context) -> task::Poll<Self::Output> {
if let State::Init(ref timeout) = &self.state {
let mut fd = AsyncFd::new(T::new()).expect("To create AsyncFd");
let mut fd = AsyncFd::with_interest(T::new(), tokio::io::Interest::READABLE).expect("To create AsyncFd");
fd.get_mut().set(*timeout);
self.state = State::Running(fd, false)
};
Expand Down

0 comments on commit 0775bf5

Please sign in to comment.