add tokio-console support

This commit is contained in:
nora 2022-02-20 22:03:39 +01:00
parent f2195133fb
commit ab736984cc
6 changed files with 456 additions and 18 deletions

View file

@ -14,7 +14,7 @@ once_cell = "1.9.0"
rand = "0.8.4"
regex = "1.5.4"
thiserror = "1.0.30"
tokio = { version = "1.16.1", features = ["full"] }
tokio = { version = "1.16.1", features = ["full", "tracing"] }
tracing = "0.1.30"
uuid = "0.8.2"

View file

@ -8,7 +8,6 @@ mod sasl;
#[cfg(test)]
mod tests;
use crate::connection::Connection;
use amqp_core::GlobalData;
use anyhow::Result;
@ -39,6 +38,8 @@ pub async fn do_thing_i_guess(global_data: GlobalData) -> Result<()> {
let connection = Connection::new(id, stream, connection_handle, global_data.clone());
tokio::spawn(connection.start_connection_processing().instrument(span));
tokio::task::Builder::new()
.name(&format!("connection {id}"))
.spawn(connection.start_connection_processing().instrument(span));
}
}