/futures-stop

An example implementation allowing future-rs Streams to be stopped from anywhere

Primary LanguageRust

futures-stop

An example implementation of allowing futures::Streams to be stopped remotely.

This is a very simple implementation which wraps a stream with another stream that will finish when it receives a message from a sender.

API Documentation

Usage

let (stream, handle) = futures_stop::convert_to_stoppable(stream);

// ...

handle.stop().wait().unwrap();
// or
handle.wait().stop();