jonhoo / stream-cancel

A Rust library for interrupting asynchronous streams.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no method named `take_until` found for type `futures_channel::mpsc::UnboundedReceiver<()>` in the current scope

mikecaines opened this issue · comments

I'm running into this error during migration from futures 0.1 to 0.3. It can be reproduced by the below code. Any thoughts? I'm not sure if it is actually a stream-cancel issue, or if there is just some new thing I need to do with futures 0.3.

fn main() {
    use stream_cancel::StreamExt;
    let (tx, rx) = futures::channel::mpsc::unbounded::<()>();
    let (trigger, tripwire) = stream_cancel::Tripwire::new();
    let rx = rx.take_until(tripwire);
}

Yeah, until the next tokio release that uses futures 0.3.0, you will have to use the futures-preview 0.3.0-alpha crates :)