Skip to main content

Crate ruststream_zeromq

Crate ruststream_zeromq 

Source
Expand description

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 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.

Structs§

ConnectedZmqFanout
The connected form of ZmqFanout.
ConnectedZmqQueue
The connected form of ZmqQueue; sockets attach lazily per subscription and publisher.
ConnectedZmqRpc
The connected form of ZmqRpc.
ZmqEndpoint
An address (tcp://... or ipc://...) with an explicit listening role.
ZmqFanout
The PUB/SUB fan-out: each message reaches every subscriber whose name prefix matches.
ZmqFanoutPublish
The publish policy for ZmqFanoutPublisher.
ZmqFanoutPublisher
Publishes to the fan-out over a lazily attached PUB socket.
ZmqMessage
A message delivered by one of the transport’s subscribers.
ZmqQueue
The PUSH/PULL queue: each message reaches one of the competing consumers.
ZmqQueuePublish
The publish policy for ZmqQueuePublisher.
ZmqQueuePublisher
Publishes into the queue over a lazily attached PUSH socket.
ZmqRpc
The DEALER/ROUTER request-reply pattern.
ZmqRpcPublish
The publish policy for ZmqRpcPublisher.
ZmqRpcPublisher
Publishes replies back through the responder’s ROUTER, and issues requests via RequestReply.
ZmqSubscriber
A subscription on one of the transport’s patterns; yields ZmqMessages.

Enums§

ZmqError
Errors returned by the ZeroMQ transport.