Module workflow_rs::core::channel
source · Expand description
async_std::channel re-exports and shims
Structs§
Channelstruct that combinesasync_std::channel::Senderandasync_std::channel::Receiverinto a single struct withsenderandreceivermembers representing a single channel.DuplexChannelcontains 2 channelsrequestandresponsemeant 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 newMultiplexerChannelinstance. The receiving channel gets unregistered whenMultiplexerChannelis dropped or the underlyingReceiveris closed. - Receiving channel endpoint for the
Multiplexer.MultiplexerChannel<T>holds aSenderand theReceiverchannel endpoints. TheSenderis 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.