async-amqp

Crates.ioasync-amqp
lib.rsasync-amqp
version2.0.0
sourcesrc
created_at2020-04-11 14:30:21.968898
updated_at2022-02-02 20:03:28.839623
descriptionlapin integration with async-std
homepage
repositoryhttps://github.com/amqp-rs/lapin
max_upload_size
id228673
size43,397
Marc-Antoine Perennou (Keruspe)

documentation

https://docs.rs/async-amqp

README

Lapin integration with async-std

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

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

#[async_std::main]
async fn main() -> Result<()> {
    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_std()).await?; // Note the `with_async_std()` here
    let channel = conn.create_channel().await?;

    // Rest of your program
}
Commit count: 1832

cargo fmt