Skip to content

hintjens/zmq.rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zmq.rs - native stack of ØMQ in Rust

zmq.rs is a native implementation of ØMQ in the Rust programming language. It is still in a very early stage of designing and development, so it is not supposed to be used seriously now.

Ownership and License

The contributors are listed in AUTHORS. This project uses the MPL v2 license, see LICENSE.

zmq.rs uses the C4.1 (Collective Code Construction Contract) process for contributions.

zmq.rs uses this style guide found on Rust wiki for code style.

To report an issue, use the zmq.rs issue tracker at github.com.

Usage

There are only very few interfaces implemented till now. Try this example as src/hello-zmq.rs:

extern crate zmq;

fn main() {
    let ctx = zmq::Context::new();

    let mut req = ctx.socket(zmq::REQ);
    req.connect("tcp://127.0.0.1:12347").unwrap();

    let mut rep = ctx.socket(zmq::REP);
    rep.bind("tcp://127.0.0.1:12347").unwrap();

    let mut msg = box zmq::Msg::new(4);
    msg.data.push_all([65u8, 66u8, 67u8, 68u8]);

    req.msg_send(msg).unwrap();
    println!("We got: {}", rep.msg_recv().unwrap());
}

We recommend using cargo to build this program. Create a file Cargo.toml with:

[package]

name = "hello-zmq"
version = "0.1.0"
authors = ["you@example.com"]

[[bin]]

name = "hello-zmq"

[dependencies.zmq]

git = "https://github.com/zeromq/zmq.rs.git"

Then build and run with cargo, who will automatically download and build the dependencies for you:

$ cargo build
$ ./target/hello-zmq

Development

Under C4.1 process, you are more than welcome to help us by:

  • join the discussion over anything from design to code style
  • fork the repository and have your own fixes
  • send us pull requests
  • and even star this project ^_^

To run the test suite:

cargo test

Community

As for now it is just me (fantix). You can find me at:

About

A native implementation of ØMQ in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published