-
Notifications
You must be signed in to change notification settings - Fork 818
Closed
Labels
Description
I do not believe that the removal of Registration/SetReadiness functionality in #907 can be completely replaced by Waker without the ability to signal both Interest::READABLE and Interest::WRITABLE.
Using 0.6, I was able to implement something equivalent to a Linux veth pair using two SPSC queues and the following logic–
fn update_readiness(&mut self) {
let mut local_readiness = mio::Ready::empty();
let mut remote_readiness = mio::Ready::empty();
if !self.rx_buffer.is_empty() {
local_readiness |= mio::Ready::readable();
}
if !self.rx_buffer.is_full() {
remote_readiness |= mio::Ready::writable();
}
if !self.tx_buffer.is_full() {
local_readiness |= mio::Ready::writable();
}
if !self.tx_buffer.is_empty() {
remote_readiness |= mio::Ready::readable();
}
if self.local_readiness.readiness() != local_readiness {
self.local_readiness.set_readiness(local_readiness).ok();
}
if self.remote_readiness.readiness() != remote_readiness {
self.remote_readiness.set_readiness(remote_readiness).ok();
}
}Reactions are currently unavailable