adamo 0.1.92

Rust SDK for the Adamo Network — low-latency robotics pub/sub and video streaming.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::time::Duration;

use adamo::{Protocol, PublishOptions, Session};

fn main() -> adamo::Result<()> {
    let api_key = std::env::var("ADAMO_API_KEY").expect("set ADAMO_API_KEY");
    let session = Session::open(&api_key, Protocol::Quic)?;
    println!("connected to org: {}", session.org()?);

    let sub = session.subscribe("demo/rs")?;
    session.put("demo/rs", b"hello from rust", PublishOptions::default())?;

    let sample = sub.recv(Some(Duration::from_secs(5)))?;
    println!("got {} bytes on {}", sample.payload.len(), sample.key);
    Ok(())
}