8 releases

0.3.5 Jan 15, 2024
0.3.4 Nov 1, 2023
0.3.3 Dec 27, 2021
0.3.0 Oct 29, 2021
0.1.0-pre Dec 18, 2014

#74 in Network programming

Download history 1395/week @ 2024-01-03 1647/week @ 2024-01-10 1300/week @ 2024-01-17 1559/week @ 2024-01-24 1544/week @ 2024-01-31 1515/week @ 2024-02-07 1652/week @ 2024-02-14 1582/week @ 2024-02-21 2141/week @ 2024-02-28 1725/week @ 2024-03-06 1557/week @ 2024-03-13 1621/week @ 2024-03-20 1940/week @ 2024-03-27 1792/week @ 2024-04-03 1757/week @ 2024-04-10 1419/week @ 2024-04-17

7,129 downloads per month
Used in 6 crates

MIT license

135KB
3.5K SLoC

zmq.rs - A native Rust implementation of ZeroMQ

DISCLAIMER: The codebase is very much a work in progress and feature incomplete. DO NOT USE IN PRODUCTION

ZeroMQ is a high-performance asynchronous messaging library that provides many popular messaging patterns for many transport types. They look and feel like Berkeley style sockets, but are fault tolerant and easier to use. This project aims to provide a native rust alternative to the reference implementation, and leverage Rust's async ecosystem.

Current status

A basic ZMTP implementation is working, but is not yet fully compliant to the spec. Integration tests against the reference implementation are also missing. External APIs are still subject to change - there are no semver or stability guarantees at the moment.

Supported transport types:

We plan to support most of the basic ZMQ sockets. The current list is as follows:

  • TCP
  • IPC (unix only)

Supported socket patterns:

We plan to support most of the basic ZMQ messaging patterns. The current list is as follows:

  • Request/Response (REQ, REP, DEALER, ROUTER)
  • Publish/Subscribe (PUB, SUB)
  • Pipeline (PUSH, PULL)

Usage

See the examples for some ways to get up and running quickly. You can also generate the documentation by doing cargo doc --open on the source code.

Choosing your async runtime

The project currently supports both tokio and async-std, controllable via feature flags. tokio is used by default. If you want to use async-std, you would disable the default features, and then select the async-std-runtime feature. For example in your Cargo.toml, you might specify the dependency as follows:

zeromq = { version = "*", default-features = false, features = ["async-std-runtime", "all-transport"] }

See the section about feature flags for more info.

Feature Flags

Feature flags provide a way to customize the functionality provided by this library. Refer to the cargo guide for more info.

Features:

  • (default) tokio-runtime: Use tokio as your async runtime.
  • async-std-runtime: Use async-std as your async runtime.
  • (default) all-transport: Enable all the *-transport flags
  • ipc-transport: Enable IPC as a transport mechanism
  • tcp-transport: Enable TCP as a transport mechanism

Contributing

Contributions are welcome! See our issue tracker for a list of the things we need help with.

Questions

You can ask quesions in our Discord channel - https://discord.gg/pFXSqWtjQT

Dependencies

~6–21MB
~261K SLoC