Move desync check back a bit
This commit is contained in:
parent
9d25328322
commit
bf021bb475
@ -99,14 +99,15 @@ impl<'a> Iterator for BlockingIter<'a> {
|
||||
|
||||
fn next(&mut self) -> Option<Result<Notification>> {
|
||||
let mut conn = self.conn.conn.borrow_mut();
|
||||
if conn.is_desynchronized() {
|
||||
return Some(Err(Error::IoError(desynchronized())));
|
||||
}
|
||||
|
||||
if let Some(notification) = conn.notifications.pop_front() {
|
||||
return Some(Ok(notification));
|
||||
}
|
||||
|
||||
if conn.is_desynchronized() {
|
||||
return Some(Err(Error::IoError(desynchronized())));
|
||||
}
|
||||
|
||||
match conn.read_message_with_notification() {
|
||||
Ok(NotificationResponse { pid, channel, payload }) => {
|
||||
Some(Ok(Notification {
|
||||
|
Loading…
Reference in New Issue
Block a user