Module mpmc_sync

Source

Structs§

StochasticMpmcReceiver
Receiver for a stochastic MPMC channel. Create one using stochastic_channel(). This receiver can be cheaply cloned, which will increase the receiver count. Dropping a receiver will decrease the receiver count.
StochasticMpmcReceiverIterator
Iterator over items sent in a channel. This will keep producing items until there are no more senders. The current thread will be blocked while waiting for an item or until there are no more senders. Not all items sent will be received by this iterator, as there may be other receivers.
StochasticMpmcSender
Sender for a stochastic MPMC channel. Create one using stochastic_channel(). This sender can be cheaply cloned, which will increase the sender count. Dropping a sender will decrease the sender count.

Enums§

StochasticMpmcRecvError
Errors that could occur when receiving an item from a stochastic channel.
StochasticMpmcRecvTimeoutError
Errors that could occur when receiving an item from a stochastic channel with a timeout.
StochasticMpmcSendError
Errors that could occur when sending an item in a stochastic channel.

Functions§

stochastic_channel
Create a MPMC channel that receives items in a uniformly random order but without any delays. Returns a tuple containing the sender and receiver, both of which can be cheaply cloned. Senders and receivers will continue to work until there are no more senders/receivers on the other side.