I am apparently too stupid to be able to make a method that returns a Stream of Result<Bytes> from a stream::unfold which does as async read of file chunks because I have no clue why the chunk read needs to be Send and what that even means

I threw a tokio::sync::mpsc::channel into the mix and did the un-Send-able stuff in a separate task. and it magically works now.

Follow

AHA! Apparently I can get around this by using `tokio::task::spawn_local` instead of `tokio::spawn` according to this response to a deleted reddit post from two years ago. Yes my life expectancy got reduced a little while trying to figure this out.

reddit.com/r/rust/comments/10x

· · Web · 0 · 0 · 1
Sign in to participate in the conversation
Mauvestodon

Escape ship from centralized social media run by Mauve.