chore(rust): fix debug printing and handle empty recv error
-use std::sync::mpsc::{self, Receiver, Sender};
+use std::sync::mpsc::{self, Receiver, Sender, TryRecvError};
use ockam_common::commands::ockam_commands::*;
use ockam_message::message::{AddressType, Message as OckamMessage};
@@ -39,10 +39,13 @@ impl Worker {
false
}
},
- Err(e) => {
+ Err(e) => match e {
+ TryRecvError::Empty => true,
+ _ => {
eprintln!("failed to recv worker rx: {:?}", e);
- true
+ false
}
+ },
}
}
}
