10 releases

0.4.1 Oct 10, 2024
0.4.0 Jun 3, 2024
0.3.5 Jan 15, 2024
0.3.4 Nov 1, 2023
0.1.0-pre Dec 18, 2014

#72 in Network programming

Download history 3992/week @ 2024-07-18 4110/week @ 2024-07-25 4213/week @ 2024-08-01 3289/week @ 2024-08-08 3256/week @ 2024-08-15 4332/week @ 2024-08-22 4288/week @ 2024-08-29 4091/week @ 2024-09-05 3749/week @ 2024-09-12 3619/week @ 2024-09-19 3831/week @ 2024-09-26 4105/week @ 2024-10-03 4845/week @ 2024-10-10 4065/week @ 2024-10-17 4244/week @ 2024-10-24 4114/week @ 2024-10-31

18,076 downloads per month
Used in 13 crates (9 directly)

MIT license

140KB
3.5K SLoC

zmq.rs - A native Rust implementation of ZeroMQ

DISCLAIMER: This codebase does not implement all of ZeroMQ's feature set.

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

Basic ZMTP implementation is working and tested against the reference implementation.

Supported transport types:

  • TCP
  • IPC (unix only)

Supported socket patterns:

  • 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 tokio, async-std, and async-dispatcher 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.
  • async-dispatcher-runtime: Use async-dispatcher 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–18MB
~245K SLoC