pollable-map
Collections of futures and streams that can be polled as a single stream, along with utilities.
Description
pollable-map provides keyed collections of futures and streams that can be
polled as a single stream, along with related asynchronous utilities.
Overview
FutureMappolls a collection of futures assigned to a specific key.StreamMappolls a collection of streams assigned to a specific key.FutureSetpolls futures without assigning user-provided keys.StreamSetcombines streams without exposing internal keys.OrderedFutureSetpolls futures one at a time in FIFO order.Optional<T>is similar toOption<T>but is a reusable future or stream that can be empty and later receive another task.- Timeout map, set, and optional wrappers are available with the
timeoutfeature.
Maps and optional tasks remain reusable after becoming empty. Set
FutureMap::set_terminate_on_empty or StreamMap::set_terminate_on_empty to true to make it behave as a
terminated stream after all current entries complete.
Examples
FutureMap example
use BoxFuture;
use StreamExt;
use FutureMap;
StreamMap example
use BoxStream;
use StreamExt;
use StreamMap;
License
Dual licensed under the MIT License or the Apache License 2.0. You may choose either license.