Module burger::depressurize

source ·
Expand description

In burger backpressure is exerted by Service::acquire. The ServiceExt::depressurize combinator returns Depressurize, which moves the Service::acquire execution into the Service::call, causing Service::acquire to resolve immediately.

§Example

use burger::*;

let svc = service_fn(|x: usize| async move {
    sleep(Duration::from_secs(1)).await;
    x.to_string()
})
.concurrency_limit(1)
.depressurize();
let permit = svc.acquire().now_or_never().unwrap();

§Load

The Load::load on Depressurize defers to the inner service.

Structs§