Writing tokio code in rust has been difficult because of the Tokio Reform described in tokio.rs/blog/2018-02-tokio-… . The crate documentation doesn't clearly describe which crates are "old" and which are "new"... and mixing old and new leads to inscrutable error messages.
2
2
7
I think, though, that tokio-core and tokio-io are old and busted, and the stuff in tokio::runtime and tokio::reactor are the new hotness?
1
The thing I'm working on depends on crates (like hyper) that depend on the old stuff, which means I can't use *any* of the new stuff, or things blow up ("what do you mean, that stream type doesn't implement Future?").
2
Things are kind of a mess right now. We're not even using tokio but we can't upgrade `futures` because `futures_cpupool` hasn't updated.
1
1
On the other hand, maybe these inscrutable errors weren't caused by what I thought they were caused by, because now that I've converted everything back to old tokio I get them again.
1
I don't yet have an intuitive sense of rust error checking stages beyond knowing that I won't get borrow checker errors until I've fixed everything else.
1
Streams and Futures are distinct things and trying to pass one of them off as the other will blow up. There's the Stream::into_future adapter to turn a Stream into a Future resolving to the next item.
1
1
What I was trying to do was pass the stream off to the Core or Handle to run (pump?) it to completion. I'd thought I'd done that before, but in hindsight I'd only passed the result of stream.join(future) to one elsewhere in a way that worked.
Mar 28, 2018 · 7:12 PM UTC
1


