#amqp #rabbitmq #mio #futures

lapin-async-global-executor

lapin integration with async-global-executor

9 releases (3 stable)

2.0.0 Dec 23, 2020
1.1.0 Nov 21, 2020
1.0.0 Oct 31, 2020
0.4.1 Oct 16, 2020
0.1.0 Aug 27, 2020

#13 in #mio

Download history 16/week @ 2020-12-23 13/week @ 2020-12-30 5/week @ 2021-01-06 18/week @ 2021-01-13 13/week @ 2021-01-20 9/week @ 2021-01-27 18/week @ 2021-02-03 120/week @ 2021-02-10 34/week @ 2021-02-17 5/week @ 2021-02-24 10/week @ 2021-03-03 7/week @ 2021-03-10 17/week @ 2021-03-17 20/week @ 2021-03-24 30/week @ 2021-03-31 19/week @ 2021-04-07

91 downloads per month

MIT license

330KB
8K SLoC

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
    })
}

Dependencies

~7.5MB
~171K SLoC