GithubHelp home page GithubHelp logo

rust-zmq's Introduction

Rust ZeroMQ bindings.

Travis Build Status Appveyor Build status Coverage Status Apache 2.0 licensed MIT licensed crates.io docs

Documentation

Release Notes

Installation

Currently, rust-zmq requires ZeroMQ 4.1 or newer. For example, on recent Debian-based distributions, you can use the following command to get the prerequiste headers and library installed:

apt install libzmq3-dev

If your OS of choice does not provide packages of a new-enough libzmq, you will first have to install it from source; see https://github.com/zeromq/libzmq/releases.

rust-zmq uses cargo to install. Users should add this to their Cargo.toml file:

[dependencies]
zmq = "0.8"

The build normally uses pkg-config to find out about libzmq's location. If that is not available, the environment variable LIBZMQ_PREFIX (or alternatively, LIBZMQ_LIB_DIR and LIBZMQ_INCLUDE_DIR) can be defined to avoid the invocation of pkg-config.

Usage

rust-zmq is a pretty straight forward port of the C API into Rust:

extern crate zmq;

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

    let mut socket = ctx.socket(zmq::REQ).unwrap();
    socket.connect("tcp://127.0.0.1:1234").unwrap();
    socket.send_str("hello world!", 0).unwrap();
}

You can find more usage examples in https://github.com/erickt/rust-zmq/tree/master/examples.

Contributing

Install for contributing to rust-zmq:

% git clone https://github.com/erickt/rust-zmq
% cd rust-zmq
% cargo build

Note that the master branch is currently in API-breaking mode while we try to make the API more ergomic and flexible for the 0.9 release series.

This means that pull requests (e.g. bugfixes), which do not need to break API should be submitted for the release/v0.8 branch. This also applies to new features, if they can be implemented in an API-compatible way, the pull request should also aim for release/v0.8. Please submit an issue for missing features before you start coding, so the suitable branch and other potential questions can be clarified up-front.

The reason for using branches, and thus increasing overhead a bit for all involved, is that it's not yet clear how long it will take to reach a point in master that we feel comfortable with releasing as 0.9.0, as we'd like to have the core part of the API more-or-less fixed by then. Using the release/v0.8 branch we can deliver bugfixes and smaller features in the meantime without forcing users to follow master's changing API and to continuously adjust their code to API changes.

rust-zmq's People

Contributors

erickt avatar jedisct1 avatar rotty avatar birkenfeld avatar emberian avatar drbawb avatar petehayes102 avatar dysn avatar dcbishop avatar tcosprojects avatar reset avatar buster avatar dwrensha avatar cristicbz avatar bombela avatar pfernie avatar smvv avatar thomascellerier avatar serprex avatar dginev avatar dougroyal avatar huonw avatar rolftimmermans avatar belisarius222 avatar kpcyrd avatar alexheretic avatar apoelstra avatar brson avatar cjs77 avatar frewsxcv avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.