Replies: 2 comments
-
Here is what could be changed: hurlebouc@7b69d2a |
Beta Was this translation helpful? Give feedback.
0 replies
-
I recently hit something like this, and eventually realized you could just call Box::pin(TimeoutBody::new(
Duration::from_secs(30),
req.into_body(),
))) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Currently
TimeoutBody
depends ontokio::time::Sleep
which is!Unpin
. This result isTimeoutBody
notUnpin
either.This situation may be problematic, for instance, when using a
TimeoutBody
as anAsyncBufRead
(thanks totokio_util::io::stream_reader::StreamReader
for instance) since majority of functions (likeread_line
for instance) ask for anUnpin
stream.It is not difficulte to make
StreamReader
Unpin by replacingSleep
byPin<Box<Sleep>>
. What do you thing about this change?Beta Was this translation helpful? Give feedback.
All reactions