Skip to main content

send_delay

Function send_delay 

Source
pub async fn send_delay(
    topic: &str,
    data: HashMap<String, String>,
    duration: Duration,
) -> Result<(), ZimqError>
Expand description

Publishes a delayed message to the specified topic.

§Arguments

  • topic - Message topic
  • data - Message data
  • duration - Duration

§Errors

  • ZimqError

§Examples

let mut data = HashMap::new();
data.insert("id".to_string(), "123456".to_string());
let result = zimq::send_delay("user",data,Duration::from_secs(20)).await