Skip to content

Commit e898da2

Browse files
authored
Unblock (#26)
Use smol unblock functionality for polling.
1 parent 5ae876b commit e898da2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/packet/future.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub enum InterfaceReady {
5151
No,
5252
}
5353

54-
async fn poll_ready(
54+
fn poll_ready(
5555
fd: std::os::unix::io::RawFd,
5656
timeout: Option<Duration>,
5757
) -> Result<InterfaceReady, Error> {
@@ -76,7 +76,8 @@ async fn poll_ready(
7676
impl DispatchArgs {
7777
async fn poll(&self, timeout: Option<Duration>) -> Result<InterfaceReady, Error> {
7878
trace!("Polling FD with timeout {:?}", timeout);
79-
smol::block_on(poll_ready(self.fd.clone(), timeout))
79+
let fd = self.fd.clone();
80+
smol::unblock(move || poll_ready(fd, timeout)).await
8081
}
8182
}
8283

0 commit comments

Comments
 (0)