deprecated async-lapin

lapin integration with async-io

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
Download history 520/week @ 2024-07-22 519/week @ 2024-07-29 602/week @ 2024-08-05 587/week @ 2024-08-12 266/week @ 2024-08-19 272/week @ 2024-08-26 637/week @ 2024-09-02 390/week @ 2024-09-09 649/week @ 2024-09-16 481/week @ 2024-09-23 501/week @ 2024-09-30 833/week @ 2024-10-07 545/week @ 2024-10-14 838/week @ 2024-10-21 679/week @ 2024-10-28 641/week @ 2024-11-04

2,704 downloads per month
Used in 7 crates (3 directly)

MIT license

340KB
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

~8–18MB
~269K SLoC