Skip to main content

Module stream

Module stream 

Source
Expand description

Server-Sent Events stream source adapter Server-Sent Events (SSE) stream adapter.

Implements [StreamSourcePort] and [ScrapingService] for consuming SSE event streams via HTTP. Uses reqwest for the underlying connection.

§Example

use stygian_graph::adapters::stream::SseSource;
use stygian_graph::ports::stream_source::StreamSourcePort;

let source = SseSource::new(None);
let events = source.subscribe("https://api.example.com/events", Some(5)).await.unwrap();
println!("received {} events", events.len());

Structs§

SseSource
Adapter: Server-Sent Events stream source.