1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! `ZeroMQ` transport implementation of the `RustStream` broker contract, for bridging to
//! non-Rust peers.
//!
//! Unlike every other broker crate, this one has no server in the middle: which side listens
//! is a deployment decision, stated explicitly on the [`ZmqEndpoint`]. Three socket patterns
//! cover three messaging shapes, over the pure-Rust
//! [`zeromq`](https://docs.rs/zeromq) implementation (TCP and IPC transports):
//!
//! - [`ZmqQueue`] - PUSH/PULL: competing consumers, round-robin.
//! - [`ZmqFanout`] - PUB/SUB: broadcast, prefix filtering by name.
//! - [`ZmqRpc`] - DEALER/ROUTER: request and reply.
//!
//! The frame layout is part of the public contract, because the peer on the other side
//! composes messages by hand: frame 0 is the name (also the subscription prefix for the
//! fan-out pattern), frame 1 the headers (`"name: value"` lines; may be empty), frame 2 the
//! payload. A Python peer sends
//! `socket.send_multipart([b"orders", b"", payload])`.
//!
//! Honest scope, stated here rather than discovered: delivery is at most once and there is
//! no durability, so acknowledgement is reported as unsupported rather than emulated; a
//! subscriber that connects after a publisher has started misses what was sent before it
//! arrived; the implementation has no encryption layer, so it is for trusted networks or for
//! use inside an existing tunnel; and it exposes no high-water-mark configuration - a slow
//! reader exerts raw TCP back-pressure on senders, except the fan-out pattern, which drops
//! unmatched messages by design.
pub use ZmqEndpoint;
pub use ZmqError;
pub use ;
pub use ZmqMessage;
pub use ;
pub use ;