[−][src]Crate postage
The feature-rich, portable async channel library. Provides a set of async channels that can be used with any async executor.
Why use Postage?
- Includes a rich set of channels, and it works with any async executor (currently regressions are written for tokio and async-std)
mpsc
, a multi-producer, single-consumer channelbroadcast
, a multi-producer, multi-consumer broadcast channel with backpressure (no lagging!)watch
, a stateful channel where receivers receive an initial value, and updates when the value state changes.oneshot
, a transfer channel that can be used once.barrier
, a channel that doesn't carry a value, but transmits when the sender half is dropped.
- Comes with built-in Stream and Sink combinators.
- Sinks can be chained, and filtered.
- Streams can be chained, filtered, mapped, and merged.
- Sinks and streams can log their values, for easy app debugging.
Postage is in beta quality. The functionality is implemented and tested, but needs to be tested on more hardware, and more operating systems.
Modules
barrier | Barrier channels can be used to synchronize events, but do not transmit any data. |
broadcast | The broadcast channel provides multi-sender, multi-receiver message dispatch. All receivers are sent every message. The channel has a fixed capacity, and senders are suspended if the buffer is filled. |
mpsc | A fixed-capacity multi-producer, single-consumer channel. |
oneshot | Oneshot channels transmit a single value between a sender and a reciever. |
watch | Watch channels can be used to asynchronously transmit state. |
Structs
RecvFuture | A future returned by |
SendError | An error type returned by |
SendFuture | A future returned by |
Enums
PollRecv | An enum of poll responses that are produced by Stream implementations. |
PollSend | An enum of poll responses that are produced by Sink implementations. |
TryRecvError | An error type returned by |
TrySendError | An error type returned by |
Traits
Sink | A sink which can asynchronously accept messages, and at some point may refuse to accept any further messages. |
Stream | An asynchronous stream, which produces a series of messages until closed. |