tokio-stream chunks_timeout only works in a tokio runtime context #5031
Labels
A-tokio-stream
Area: The tokio-stream crate
C-bug
Category: This is a bug.
E-easy
Call for participation: Experience needed to fix: Easy / not much
E-help-wanted
Call for participation: Help is requested to fix this issue.
M-time
Module: tokio/time
Version
tokio-stream 0.1.10
Description
ChunkTimeout::new
callstokio::time::sleep
(see code) which can only be called in a tokio runtime context. This is undesirable as constructing the stream is often done outside a runtime. It should be possible to changedeadline
toOption
and initialize it withNone
instead. The call tosleep
is only used to generate a default value, but the actual deadline is not used inpoll
, instead it is overwritten (see code).I tried this code:
I expected to see this happen:
Run without crashing.
Instead, this happened:
The text was updated successfully, but these errors were encountered: