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
//! Server-Sent Events (SSE) support for hpx.
//!
//! This module provides a reconnecting SSE client built on top of hpx's HTTP client.
//!
//! # Example
//!
//! ```rust,no_run
//! use futures_util::StreamExt;
//! use hpx::sse::{RequestBuilderSseExt, SseEvent};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut source = hpx::get("https://example.com/events").into_event_source();
//!
//! while let Some(event) = source.next().await {
//! match event? {
//! SseEvent::Open => println!("connected"),
//! SseEvent::Message(msg) => println!("{}: {}", msg.event, msg.data),
//! SseEvent::Error(err) => eprintln!("reconnecting: {err}"),
//! }
//! }
//! # Ok(())
//! # }
//! ```
pub use ;
pub use ;
pub use SseRetryConfig;
pub use ;