def request.as

bend-kit-hairpin@0.13.0.1 · hairpin.bend:458

import bend-kit-hairpin@0.13.0.1/hairpin.bend as Hairpin
import Base
import bend-kit-http@0.38.1.1/http.bend as Http
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-retry@0.2.0.0/retry.bend as Retry

458# One request inside a caller's retry layer, with every choice explicit. Every attempt takes from b, the
459# caller's shared budget, and obeys its deadline; the client's own policy caps the attempts of this call.
460# The budget left comes back beside the result: pass it to the next call, so nested layers never reset or
461# multiply it. The client's own deadline does not apply here; b's does.
462# judge: the Verdict on each attempt; Hairpin.judge is the default. idem: the request is safe to repeat, so
463# Again is retried; else the breaker counts it and it never repeats. enc: the Accept-Encoding codings.
464def request.as(~judge: Result<&1, &1, Http.Err, Http.Res> -> Result<&1, &1, Http.Err, Http.Res> & Verdict,
465    c: Client, b: Retry.Budget, +idem: Bool, +enc: String, +method: String, url: String,
466    headers: Map<&2, List<&2, String>>, body: Bytes.Bytes) -> IO(Client & Retry.Budget & Result<&1, &1, Err, Http.Res>):
467  run(~Http.Res, ~judge, ~try.res, ~close.res, c, b, idem, enc, method, url, headers, body)

Uses (17)

Used by (4)