Skip to main content

recv_all_commands

Function recv_all_commands 

Source
async fn recv_all_commands<T>(rx: &mut UnboundedReceiver<T>, out: &mut Vec<T>)
Expand description

Receive all currently enqueued messages from a task command channel.

If no messages are initially enqueued, this function blocks until messages become available or the channel is closed.

If the out buffer has a large amount of free capacity at the end of this operation, it is shrunk to reclaim some of its memory.

ยงCancel safety

This function is cancel safe. It only awaits UnboundedReceiver::recv, which is itself cancel safe.