Skip to main content

send_with_shed

Function send_with_shed 

Source
pub async fn send_with_shed<T>(
    tx: &Sender<T>,
    item: T,
    stage: PipelineStage,
) -> Result<SendOutcome, OrchestratorError>
Expand description

Send with graceful shedding on backpressure.

§Returns

  • Ok(SendOutcome::Queued) — item was accepted by the channel.
  • Ok(SendOutcome::Shed) — channel was full; item was dropped gracefully.
  • Err(OrchestratorError::ChannelClosed) — the receiver has been dropped.

§Panics

This function never panics.