Skip to content
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

Consider reducing API surface of StreamBody<T> to make it Sync when T: Send #133

Open
nox opened this issue Nov 6, 2024 · 1 comment
Open

Comments

@nox
Copy link

nox commented Nov 6, 2024

Before Hyper 1.0, hyper::Body was always Sync, and we used to make Sync bodies out of non-Sync bodies or streams by wrapping them with hyper::Body::wrap_stream. StreamBody<T> doesn't use Hyper's trick with StreamWrapper anymore so it's not Sync anymore when T: Send. We could restore this functionality if we removed trait implementations of Stream (there is BodyStream for that), Clone, and Copy, and made its implementation of Debug less useful.

@seanmonstar
Copy link
Member

I suppose it's a possibility. Another option is to add a SyncStream helper to something like futures-util.

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

No branches or pull requests

2 participants