Expand description
The feature-rich, portable async channel library.
§Why use Postage?
- Includes a rich set of channels.
- barrier, a oneshot channel that transmits when the sender half is dropped.
- broadcast, a lossless multi-producer, multi-consumer broadcast channel with backpressure (no lagging!).
- dispatch, a multi-producer, multi-consumer queue.
- mpsc, a multi-producer, single-consumer channel.
- oneshot, a oneshot transfer channel.
- watch, a state distribution channel with a value that can be borrowed.
- Works with any executor.
- Currently regressions are written for
tokio
andasync-std
. - With the
futures-traits
feature, channels implement the futuresSink/Stream
traits.
- Currently regressions are written for
- Throughly tested.
- Channels have full unit test coverage, and integration test coverage with multiple async executors.
- Comes with built-in Sink and Stream combinators.
- Sinks can be chained, and filtered.
- Streams can be chained, filtered, mapped, and merged.
- With the
logging
feature, Sinks and streams can log their values. This is really helpful when debugging applications.
See the readme for benchmarks.
§Cargo features:
blocking (default)
- enables Sink::blocking_send and Stream::blocking_recvdebug
- enables extremely verbose internal log statements.futures-traits
- enablesfutures::Sink
andfutures::Stream
implementations for the postage channels. Compatible withv0.3
.logging (default)
- enables the enables Sink::log(Level) and Stream::log(Level) combinators.
Modules§
- barrier
- Barriers transmit when the sender half is dropped, and can synchronize events in async tasks.
- broadcast
- Provides a lossless, MPMC channel. All receivers are guaranteed to recieve each message.
- dispatch
- A fixed-capacity multi-producer, multi-consumer queue. At most one receiver will observe each value.
- mpsc
- A fixed-capacity multi-producer, single-consumer channel.
- oneshot
- Oneshot channels transmit a single value between a sender and a reciever.
- prelude
- Imports the Sink and Stream traits.
- sink
- A sink for values which are asynchronously accepted, until the target is closed.
- stream
- A stream of values which are asynchronously produced, until the source is closed.
- watch
- A state distribution channel. The internal state can be borrowed or cloned, but receivers do not observe every value.
Structs§
- Context
- The
Context
of an asynchronous task.