I am apparently too stupid to be able to make a method that returns a Stream of Result 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 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.
-
> `Future is not Send`
Fudge
-
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.
-
@mauve I laughed when I saw this post because I have had this same argument with Rust multiple times. Best of luck!
-
@fabrefact I ended up inlining an async function I was calling until it worked Diverted into LocalSet for a bit which was less than fruitful