Skip to content

feat!: Replace hyper-specific interfaces with generic trait#104

Merged
keelerm84 merged 4 commits into
feat/hyper-as-featurefrom
mk/sdk-1724/remove-hyper-dependency
Jan 9, 2026
Merged

feat!: Replace hyper-specific interfaces with generic trait#104
keelerm84 merged 4 commits into
feat/hyper-as-featurefrom
mk/sdk-1724/remove-hyper-dependency

Conversation

@keelerm84
Copy link
Copy Markdown
Member

This first commit removes hyper as a direct dependency from this crate. Instead, we expose more generic types which we will implement in a subsequent PR.

As this isn't feature complete, I am merging this into a feature branch.

@keelerm84 keelerm84 requested a review from a team as a code owner January 6, 2026 15:45

// Simple reqwest-based transport implementation
#[derive(Clone)]
struct ReqwestTransport {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is temporary until we implement the hyper based version. But it keeps the tests passing without adding new dependencies.

@@ -1,54 +0,0 @@
use futures::{Stream, TryStreamExt};
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will restore this in a subsequent commit.

url: Uri,
headers: HeaderMap,
reconnect_opts: ReconnectOptions,
connect_timeout: Option<Duration>,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are features of the hyper transport, not part of the core library per se. So these will be brought back in the next PR as part of the hyper transport builder.

Happy to discuss alternatives if you would prefer, but this felt cleaner.

/// let client = ClientBuilder::for_url("https://example.com/events")?
/// .build_with_transport(transport);
/// ```
pub fn build_with_transport<T>(self, transport: T) -> impl Client
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these build methods are really to allow us to get at hyper's internals. We move them to that transport builder, and instead keep this interface simple.

* **Redirect following** - Automatic handling of HTTP redirects
* **Last-Event-ID** - Resume streams from last received event

## Migration from v0.16
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I change this later from migration guide to just examples.

@keelerm84 keelerm84 merged commit ec12251 into feat/hyper-as-feature Jan 9, 2026
4 checks passed
@keelerm84 keelerm84 deleted the mk/sdk-1724/remove-hyper-dependency branch January 9, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants