lapin-async-global-executor

Crates.iolapin-async-global-executor
lib.rslapin-async-global-executor
version3.0.0
sourcesrc
created_at2020-08-27 15:33:47.179139
updated_at2022-02-02 20:02:27.064844
descriptionlapin integration with async-global-executor
homepage
repositoryhttps://github.com/amqp-rs/lapin
max_upload_size
id281501
size39,714
Marc-Antoine Perennou (Keruspe)

documentation

https://docs.rs/lapin-async-global-executor

README

Lapin integration with async-global-executor

This crate integrates lapin with async-global-executor by using its executor inside of lapin for its internal operations and for consumer delegates.

use lapin_async_global_executor::*;
use lapin::{Connection, ConnectionProperties, Result};

fn main() -> Result<()> {
    async_global_executor::run(async {
        let addr = std::env::var("AMQP_ADDR").unwrap_or_else(|_| "amqp://127.0.0.1:5672/%2f".into());
        let conn = Connection::connect(&addr, ConnectionProperties::default().with_async_global_executor()).await?; // Note the `with_async_global_executor()` here
        let channel = conn.create_channel().await?;

        // Rest of your program
    })
}
Commit count: 1832

cargo fmt