Skip to content

Commit bf021bb

Browse files
committed
Move desync check back a bit
1 parent 9d25328 commit bf021bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/notification.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,15 @@ impl<'a> Iterator for BlockingIter<'a> {
9999

100100
fn next(&mut self) -> Option<Result<Notification>> {
101101
let mut conn = self.conn.conn.borrow_mut();
102-
if conn.is_desynchronized() {
103-
return Some(Err(Error::IoError(desynchronized())));
104-
}
105102

106103
if let Some(notification) = conn.notifications.pop_front() {
107104
return Some(Ok(notification));
108105
}
109106

107+
if conn.is_desynchronized() {
108+
return Some(Err(Error::IoError(desynchronized())));
109+
}
110+
110111
match conn.read_message_with_notification() {
111112
Ok(NotificationResponse { pid, channel, payload }) => {
112113
Some(Ok(Notification {

0 commit comments

Comments
 (0)