1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Rust client for PopSub.
//!
//! `Client` keeps a connection to a PopSub server and handles what every
//! application would otherwise have to: logging in and refreshing the token,
//! reconnecting with backoff (and knowing when not to, from the server's
//! close code), resubscribing without gaps, resending confirmed publishes
//! without duplicating them, acknowledging QoS 1 messages, and making sure
//! each `(topic, seq)` reaches the application once.
//!
//! Example:
//!
//! ```no_run
//! use popsub_sdk::{Client, ClientConfig, Credentials, StartFrom};
//!
//! # async fn run() -> Result<(), popsub_sdk::Error> {
//! let config = ClientConfig::new("ws://127.0.0.1:8080", Credentials::password("alice", "secret"))
//! .session("alice-laptop");
//! let client = Client::connect(config).await?;
//!
//! let mut orders = client.subscribe("orders", StartFrom::Resume).await?;
//! let stored = client.publish_confirmed("orders", "order 42 shipped").await?;
//! println!("stored as seq {}", stored.seq);
//!
//! while let Some(message) = orders.next().await {
//! println!("{} #{}: {}", message.topic, message.seq, message.payload);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! The protocol itself is in `popsub_protocol` and documented in the
//! repository's `docs/DESIGN.md` section 4.
pub use Admin;
pub use Client;
pub use ;
pub use Published;
pub use Error;
pub use ;
pub use ;