17 releases (6 stable)

2.0.0 Feb 2, 2022
1.3.0 Jan 30, 2022
1.2.0 Feb 17, 2021
1.1.0 Nov 21, 2020
0.2.1 Jul 24, 2020

#6 in #amqp0-9-1

Download history 74/week @ 2023-01-25 111/week @ 2023-02-01 164/week @ 2023-02-08 125/week @ 2023-02-15 121/week @ 2023-02-22 163/week @ 2023-03-01 139/week @ 2023-03-08 173/week @ 2023-03-15 258/week @ 2023-03-22 148/week @ 2023-03-29 81/week @ 2023-04-05 182/week @ 2023-04-12 90/week @ 2023-04-19 104/week @ 2023-04-26 180/week @ 2023-05-03 207/week @ 2023-05-10

590 downloads per month
Used in 7 crates (3 directly)

MIT license

335KB
9K SLoC

Lapin integration with async-io

This crate integrates lapin with async-io by using async-io's reactor inside of lapin.

use async_lapin::*;
use lapin::{executor::Executor, Connection, ConnectionProperties, Result};
use std::{future::Future, pin::Pin};

fn main() -> Result<()> {
    async_global_executor::block_on(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_io(SmolExecutor)
        )
        .await?; // Note the `with_async_io()` here
        let channel = conn.create_channel().await?;

        // Rest of your program
    })
}

Dependencies

~7–14MB
~282K SLoC