add dashboard

This commit is contained in:
nora 2022-02-19 21:53:02 +01:00
parent 077b6fd633
commit dc8efd4e4e
13 changed files with 777 additions and 33 deletions

View file

@ -26,15 +26,17 @@ pub struct Connection {
max_frame_size: usize,
heartbeat_delay: u16,
channel_max: u16,
connection_handle: amqp_core::ConnectionHandle,
}
impl Connection {
pub fn new(stream: TcpStream) -> Self {
pub fn new(stream: TcpStream, connection_handle: amqp_core::ConnectionHandle) -> Self {
Self {
stream,
max_frame_size: FRAME_SIZE_MIN_MAX,
heartbeat_delay: HEARTBEAT_DELAY,
channel_max: CHANNEL_MAX,
connection_handle,
}
}
@ -43,6 +45,9 @@ impl Connection {
Ok(()) => {}
Err(err) => error!(%err, "Error during processing of connection"),
}
let connection_handle = self.connection_handle.lock();
connection_handle.close();
}
pub async fn process_connection(&mut self) -> Result<()> {