message_queue_service 0.1.3

A simple Message Queue implementation using Tokio and Serde
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate message_queue_service;
extern crate tokio_proto;

use tokio_proto::TcpServer;

pub fn main() {
    // Specify the localhost address
    let addr = "0.0.0.0:12345".parse().unwrap();

    // The builder requires a protocol and an address
    let server = TcpServer::new(message_queue_service::mqs::MessageProto, addr);

    // We provide a way to *instantiate* the service for each new
    // connection; here, we just immediately return a new instance.
    server.serve(|| Ok(message_queue_service::mqs::MessageQueue));
}