This crate integrates lapin with async-global-executor by using its executor inside of lapin for its internal operations and for consumer delegates.
``` use lapinasyncglobal_executor::*; use lapin::{Connection, ConnectionProperties, Result};
fn main() -> Result<()> {
asyncglobalexecutor::run(async {
let addr = std::env::var("AMQPADDR").unwraporelse(|| "amqp://127.0.0.1:5672/%2f".into());
let conn = Connection::connect(&addr, ConnectionProperties::default().withasyncglobalexecutor()).await?; // Note the with_async_global_executor()
here
let channel = conn.createchannel().await?;
// Rest of your program
})
} ```