Module async_zmq::xpublish

source ·
Expand description

XPUB socket module of Pub-Sub pattern in ZMQ

Use the xpublish function to instantiate an xpublish socket and use methods from the Sink/SinkExt and Stream/StreamExt traits.

An xpublish socket must be paired with a subscribe or xsubscribe socket.

Example

use async_zmq::{Result, SinkExt};

#[async_std::main]
async fn main() -> Result<()> {
    let mut zmq = async_zmq::xpublish("tcp://127.0.0.1:5555")?.bind()?;

    zmq.send(vec!["topic", "broadcast message"].into()).await?;
    Ok(())
}

Structs

  • The async wrapper of ZMQ socket with XPUB type

Functions

  • Create a ZMQ socket with XPUB type