Remove Sync requirement from response bodies (#440)

As we learned [in Tonic] bodies don't need to be `Sync` because they can
only be polled from one thread at a time.

This changes axum's bodies to no longer require `Sync` and makes
`BoxBody` an alias for `UnsyncBoxBody<Bytes, axum::Error>`.

[in Tonic]: https://github.com/hyperium/tonic/issues/117
This commit is contained in:
David Pedersen
2021-11-01 22:37:16 +01:00
committed by GitHub
parent 9465128f3e
commit 3d07d40e02
13 changed files with 47 additions and 30 deletions
+2 -2
View File
@@ -281,8 +281,8 @@ where
S::Future: Send,
T: 'static,
ReqBody: Send + 'static,
ResBody: http_body::Body<Data = Bytes> + Send + Sync + 'static,
ResBody::Error: Into<BoxError> + Send + Sync + 'static,
ResBody: http_body::Body<Data = Bytes> + Send + 'static,
ResBody::Error: Into<BoxError>,
{
type Sealed = sealed::Hidden;