17 个版本 (6 个稳定)
2.0.0 | 2022年2月2日 |
---|---|
1.3.0 | 2022年1月30日 |
1.2.0 | 2021年2月17日 |
1.1.0 | 2020年11月21日 |
0.2.1 | 2020年7月24日 |
#59 在 #rabbitmq
1,781 每月下载
用于 7 个crate (3 直接)
340KB
9K SLoC
lapin与async-io集成
此crate通过在lapin内部使用async-io的reactor来集成lapin与async-io。
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
})
}
依赖项
~8–18MB
~276K SLoC