amqpr-api

Crates.ioamqpr-api
lib.rsamqpr-api
version0.4.1
sourcesrc
created_at2017-09-30 06:18:52.005667
updated_at2017-12-15 14:33:51.913094
descriptionA tokio future based amqp api library
homepage
repositoryhttps://github.com/AtsukiTak/amqpr-api
max_upload_size
id33976
size60,583
Atsuki Takahashi (AtsukiTak)

documentation

README

amqpr-api

A tokio future based amqp api library.

Apache-2.0 licensed Crates.io

This library provides low lovel api. I recommend you to use amqpr library instead.

Examples

Establish connection

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();
Commit count: 37

cargo fmt