Module workflow_core::channel
source · Expand description
async_std::channel
re-exports and shims
Structs§
Channel
struct that combinesasync_std::channel::Sender
andasync_std::channel::Receiver
into a single struct withsender
andreceiver
members representing a single channel.DuplexChannel
contains 2 channelsrequest
andresponse
meant to provide for a request/response pattern. This is useful for any type of signaling, but especially during task termination, where you can request a task to terminate and wait for a response confirming its termination.- A simple MPMC (one to many) channel Multiplexer that broadcasts to multiple registered receivers.
Multiplexer<T>
itself can be cloned and used to broadcast usingMultiplexer::broadcast()
orMultiplexer::try_broadcast()
. To create a receiving channel, you can callMultiplexerChannel<T>::from()
and supply the desired Multiplexer instance, or simply callMultiplexer::channel()
to create a newMultiplexerChannel
instance. The receiving channel gets unregistered whenMultiplexerChannel
is dropped or the underlyingReceiver
is closed. - Receiving channel endpoint for the
Multiplexer
.MultiplexerChannel<T>
holds aSender
and theReceiver
channel endpoints. TheSender
is provided for convenience, allowing internal relay within this channel instance. To process events, simply iterate overMultiplexerChannel::recv()
by callingchannel.recv().await
. - The receiving side of a channel.
- An error returned from
Receiver::recv()
. - An error returned from
Sender::send()
. - The sending side of a channel.
Enums§
- An error returned from
Receiver::try_recv()
. - An error returned from
Sender::try_send()
.
Functions§
- Creates a bounded channel.
- Creates a oneshot channel (bounded channel with a limit of 1 message)
- Creates an unbounded channel.