10 releases

0.4.0 Jul 30, 2023
0.3.3 Nov 14, 2022
0.3.2 May 24, 2020
0.3.1 Apr 19, 2020
0.0.1 Feb 19, 2020

#272 in Asynchronous

Download history 529/week @ 2024-01-02 793/week @ 2024-01-09 853/week @ 2024-01-16 600/week @ 2024-01-23 960/week @ 2024-01-30 1258/week @ 2024-02-06 1732/week @ 2024-02-13 845/week @ 2024-02-20 680/week @ 2024-02-27 820/week @ 2024-03-05 621/week @ 2024-03-12 238/week @ 2024-03-19 615/week @ 2024-03-26 382/week @ 2024-04-02 500/week @ 2024-04-09 412/week @ 2024-04-16

1,984 downloads per month
Used in bitcoincore-zmq

MIT/Apache

76KB
1K SLoC

Async version for ZeroMQ bindings

Async-zmq is high-level bindings for zmq in asynchronous manner which is compatible to every async runtime. No need for configuring or tuning features. Just plug in and see how it works!

Usage

Users could simply initialize any socket type with async_zmq::* in mind, and then call bind() or connect depends on your scenario. For example, if someone wants a publish socket, then he could initialize the socket like this:

let zmq = async_zmq::publish("tcp://127.0.0.1:5555")?.bind();

If there's context need to be shared between different socket, we can set it during building the socket:

let context = Context::new();
let xpub = async_zmq::xpublish("inproc://example")?.with_context(&context).bind();
let sub = subscribe("inproc://example")?.with_context(&context).connect()?;

Since the use case of this crate is mostly for sending/recieving multipart message. So it provides Multipart which is a type alias for Vec<Message> when recieving message on type implemented with Stream, and MultipartIter which is a generic struct make any queue can turn into iterator and then send via type implemented with Sink.

To learn more about each socket type usage. See modules below.

Dependencies

~1.7–4.5MB
~75K SLoC