26 releases (3 stable)

2.0.0 Feb 2, 2022
1.1.0 Nov 21, 2020
1.0.0 Oct 31, 2020
0.5.1 Oct 16, 2020
0.3.1 Jul 23, 2020

#29 in #smol

Download history 5/week @ 2024-02-23 4/week @ 2024-03-01 90/week @ 2024-03-29 17/week @ 2024-04-05

107 downloads per month

MIT license

350KB
9K SLoC

Lapin integration with smol

This crate integrates lapin with smol by using smol's executor inside of lapin for its internal operations and for consumer delegates.

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

fn main() -> Result<()> {
    smol::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_smol()).await?; // Note the `with_smol()` here
        let channel = conn.create_channel().await?;

        // Rest of your program
    })
}

Dependencies

~9–22MB
~305K SLoC