Crates.io | amqpr-api |
lib.rs | amqpr-api |
version | 0.4.1 |
source | src |
created_at | 2017-09-30 06:18:52.005667 |
updated_at | 2017-12-15 14:33:51.913094 |
description | A tokio future based amqp api library |
homepage | |
repository | https://github.com/AtsukiTak/amqpr-api |
max_upload_size | |
id | 33976 |
size | 60,583 |
A tokio future based amqp api library.
This library provides low lovel api. I recommend you to use amqpr
library instead.
use amqpr_api::handshake::{start_handshake, SimpleHandshaker};
use tokio_core::reactor::Core;
use tokio_core::net::TcpStream;
let mut core = Core::new().unwrap();
let handshaker = SimpleHandshaker {
user: "guest".into(),
pass: "guest".into(),
virtual_host: "/".into(),
};
let future = TcpStream::connect(&"127.0.0.1:5672".parse().unwrap(), &core.handle())
.map_err(|e| Error::from(e))
.and_then(move |socket| start_handshake(handshaker, socket));
let socket = core.run(future).unwrap();