-
Notifications
You must be signed in to change notification settings - Fork 19
feat: Add HttpTransport trait abstraction #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: mk/sdk-1741/bump-hyper
Are you sure you want to change the base?
feat: Add HttpTransport trait abstraction #136
Conversation
Introduce a generic HttpTransport trait to decouple the SDK from specific HTTP client implementations. This follows the pattern established in eventsource-client. - Add transport.rs with HttpTransport trait and error types - Add transport_hyper.rs with hyper 1.0 implementation - Make hyper an optional dependency via feature flags - Use Bytes for request bodies (supports binary and empty) - Stream response bodies via ByteStream type alias This commit adds the abstraction without changing existing code. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
| default = ["rustls"] | ||
| rustls = ["hyper-rustls", "launchdarkly-server-sdk/rustls"] | ||
| default = ["hyper-rustls"] | ||
| hyper-rustls = ["dep:hyper-rustls", "launchdarkly-server-sdk/hyper-rustls"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is changing this feature name going to be a problem compatibility wise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or was this a new feature to the branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting merged into a separate branch that will become 3.x once the rest of the stuff is done. So I expect to break backwards compatibility with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is basically the same as the event source one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep.
Introduce a generic HttpTransport trait to decouple the SDK from specific HTTP client implementations. This follows the pattern established in eventsource-client.
This commit adds the abstraction without changing existing code.