[][src]Module async_zmq::xpublish

XPUB socket module of Pub-Sub pattern in ZMQ

Use xpublish function to instantiate a XPUB socket and the you will be able to use methods from both Sink/SinkExt and Stream/StreamExt traits.

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"]).await?;
    Ok(())
}

Structs

XPublish

The async wrapper of ZMQ socket with XPUB type

Functions

xpublish

Create a ZMQ socket with XPUB type