add amqp_messaging

This commit is contained in:
nora 2022-02-20 20:26:18 +01:00
parent 45196c722c
commit 3b656b911a
8 changed files with 51 additions and 12 deletions

View file

@ -197,6 +197,7 @@ impl Connection {
async fn main_loop(&mut self) -> Result<()> {
loop {
debug!("Waiting for next frame");
let frame = frame::read_frame(&mut self.stream, self.max_frame_size).await?;
debug!(?frame);
self.reset_timeout();
@ -218,8 +219,8 @@ impl Connection {
// todo: handle closing
}
Method::ChannelOpen { .. } => self.channel_open(frame.channel).await?,
_ => {
tokio::spawn(amqp_core::method::handle_method())
// we don't handle this here, forward it to *somewhere*
}
}
@ -269,8 +270,6 @@ impl Connection {
)
.await?;
time::sleep(Duration::from_secs(1000)).await; // for debugging the dashboard
Ok(())
}