launchdarkly / rust-eventsource-client

Server-sent events (SSE) client implementation for Rust
https://docs.rs/eventsource-client/latest/eventsource_client/
Other
70 stars 23 forks source link

Reset retry backoff after max retry interval #40

Closed keelerm84 closed 2 years ago

keelerm84 commented 2 years ago

According to our streaming spec, default retry behavior should continue with a backoff calculation until 60 seconds of continuous failures have occurred, after which we can reset the retry interval.

While working on this task, I extracted the retry strategy into a separate struct. This keeps the client a little cleaner, allows us to actually unit test the retry policy, and will hopefully more easily allow us to control the retry behavior for future unit tests.

shortcut-integration[bot] commented 2 years ago

This pull request has been linked to Shortcut Story #174725: Only reset stream delay after 60 seconds.

keelerm84 commented 2 years ago

I'm pretty out-of-context - am I reading it right that there's no jitter (in the previous implementation or this one)?

Correct. I am doing that in the next ticket.