amqpr-api 0.4.1

A tokio future based amqp api library
Documentation

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();