wait one second for mqtt router to start before sending init

This commit is contained in:
Evan Feenstra
2022-06-10 15:41:03 -07:00
parent 7571d9b8fd
commit da144c355a
2 changed files with 4 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ pub fn blocking_connect(tx: mpsc::Sender<ChannelRequest>) {
message: init_msg_2,
reply_tx,
};
let _ = tx.blocking_send(request);
tx.blocking_send(request).expect("could not blocking send");
let res = reply_rx.blocking_recv().expect("couldnt receive");
let reply = parser::response_from_bytes(res.reply, 0).expect("could parse init receive");
println!("REPLY {:?}", reply);

View File

@@ -94,6 +94,9 @@ pub fn start_broker(
});
});
// give one second for router to spawn listeners
std::thread::sleep(std::time::Duration::from_secs(1));
rt
}