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

Allow specifying HTTP client directly #8

Closed JiggyDown closed 3 years ago

JiggyDown commented 3 years ago

The hyper client builder allows specifying many useful options, notably pool_idle_timeout and http2_keep_alive_interval, which are super useful to make sure persistent connections stay alive.

This PR extends the rust-eventsource-client builder with the ability to pass the hyper client directly, which allows for maximal flexibility.

JiggyDown commented 3 years ago

@samstokes That makes sense. Renamed the function to build_with_http_client.

samstokes commented 3 years ago

Thanks very much @JiggyDown - I'll go ahead and merge this. Thanks again for the contribution!

I also pushed a couple of minor changes to your branch to fix some new Clippy warnings that showed up.