File tree Expand file tree Collapse file tree 3 files changed +55
-2
lines changed Expand file tree Collapse file tree 3 files changed +55
-2
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to the project will be documented in this file. This project adheres to [ Semantic Versioning] ( http://semver.org ) .
44
5+ ## [ 0.9.0] - 2022-03-15
6+ ### Added:
7+ - Added support for SSE test harness.
8+
9+ ### Changed:
10+ - Change ` ClientBuilder ` to return ` impl Client ` , where ` Client ` is a sealed trait that exposes a ` stream() ` method.
11+
12+ ### Fixed:
13+ - Fixed various bugs related to SSE protocol.
14+
515## [ 0.8.2] - 2022-02-03
616### Added:
717- Support for creating an event source client with a pre-configured connection.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # eventsource-client
2+
3+ Client for the [ Server-Sent Events] protocol (aka [ EventSource] ).
4+
5+ [ Server-Sent Events ] : https://html.spec.whatwg.org/multipage/server-sent-events.html
6+ [ EventSource ] : https://developer.mozilla.org/en-US/docs/Web/API/EventSource
7+
8+ ## Requirements
9+
10+ Requires tokio.
11+
12+ ## Usage
13+
14+ Example that just prints the type of each event received:
15+
16+ ``` rust
17+ use eventsource_client as es;
18+
19+ let mut client = es :: ClientBuilder :: for_url (" https://example.com/stream" )?
20+ . header (" Authorization" , " Basic username:password" )?
21+ . build ();
22+
23+ client
24+ . stream ()
25+ . map_ok (| event | println! (" got event: {:?}" , event ))
26+ . map_err (| err | eprintln! (" error streaming events: {:?}" , err ));
27+ ```
28+
29+ (Some boilerplate omitted for clarity; see [ examples directory] for complete,
30+ working code.)
31+
32+ [ examples directory ] : https://github.com/launchdarkly/rust-eventsource-client/tree/master/eventsource-client/examples
33+ ## Features
34+
35+ * tokio-based streaming client.
36+ * Supports setting custom headers on the HTTP request (e.g. for endpoints
37+ requiring authorization).
38+ * Retry for failed connections.
39+ * Reconnection if connection is interrupted, with exponential backoff.
40+
41+ ## Stability
42+
43+ Early stage release for feedback purposes. May contain bugs or performance
44+ issues. API subject to change.
Original file line number Diff line number Diff line change 11[package ]
22name = " eventsource-client"
3- version = " 0.8.2 "
3+ version = " 0.9.0 "
44description = " Client for the Server-Sent Events protocol (aka EventSource)"
55repository = " https://github.com/launchdarkly/rust-eventsource-client"
66authors = [" LaunchDarkly" ]
You can’t perform that action at this time.
0 commit comments