eventsource-client
Client for the Server-Sent Events protocol (aka EventSource).
Requirements
Requires tokio.
Usage
Example that just prints the type of each event received:
use Client;
let mut client = for_url?
.header?
.build;
client.stream
.for_each
.map_err;
(Some boilerplate omitted for clarity; see examples directory for complete, working code.)
Features
- tokio-based streaming client.
- Supports setting custom headers on the HTTP request (e.g. for endpoints requiring authorization).
Not yet implemented
- Retry for failed connections.
- Reconnection if connection is interrupted.
Stability
Early stage release for feedback purposes. May contain bugs or performance issues. API subject to change.