adamransom / futures-stop

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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();

About

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


Languages

Language:Rust 97.1%Language:Shell 2.9%