| Crates.io | dialectic-tokio-mpsc |
| lib.rs | dialectic-tokio-mpsc |
| version | 0.1.0 |
| created_at | 2021-04-01 22:17:40.710417+00 |
| updated_at | 2021-04-01 22:17:40.710417+00 |
| description | A backend for the Dialectic crate using Tokio's MPSC channels |
| homepage | https://github.com/boltlabs-inc/dialectic |
| repository | https://github.com/boltlabs-inc/dialectic |
| max_upload_size | |
| id | 377066 |
| size | 13,613 |
This crate contains the Tokio/MPSC backend for Dialectic. It
supports send/receive operations over all types which are Send + Any. This is useful for
inter-task and inter-thread communication, especially if you're working on a protocol which needs to
be tested locally and is written to be backend-agnostic. There are a few important types:
dialectic_tokio_mpsc::Chan<P> synonym is a quick type synonym for a channel which uses a
bounded MPSC Sender/Receiver pair, and analogously the
dialectic_tokio_mpsc::UnboundedChan<P> provides a similar functionality for unbounded MPSC channels.dialectic_tokio_mpsc::Receiver/Sender/UnboundedReceiver/UnboundedSender types
transparently wrap the underlying MPSC receiver/sender types. If not for the orphan rules,
Dialectic's Transmitter/Receiver/Transmit/Receive traits would be directly implemented
on the tokio::mpsc types, but Rust does not allow that.dialectic_tokio_mpsc::channel() and unbounded_channel() are provided for
conveniently constructing pairs of these transport types.