Hairpin.attempt: def of bend-kit-hairpin@0.13.0.1 Import: import bend-kit-hairpin@0.13.0.1/hairpin.bend as Hairpin Lines 386-395 of bend-kit-hairpin@0.13.0.1/hairpin.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&start_line=386&end_line=395 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 # Ask the gate; when it admits, make attempt n (0 first) of this layer. With no deadline and no breaker, # admission does not read the clock. def attempt(~R: Type, ~judge: Result<&1, &1, Http.Err, R> -> Result<&1, &1, Http.Err, R> & Verdict, ~try: Opts -> Call -> Http.Pool -> Maybe<&2, Http.Jar> -> Bytes.Bytes -> IO(Http.Pool & Maybe<&2, Http.Jar> & Result<&1, &1, Http.Err, R>), ~close: R -> IO(Unit), +o: Opts, +call: Call, +idem: Bool, +n: Nat, s: Step) -> IO(Step): Step{pool, jar, +br, +b, body, last, plan} = s do IO>: now : Nat <- clock(Bool.or(breaker.on(br), deadline.some(b))) attempt.gate(~R, ~judge, ~try, ~close, Retry.admit(br, b, now), o, call, idem, n, pool, jar, body, last) Uses (22): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=Call https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=Opts https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=Step https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=Verdict https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=attempt.gate https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=breaker.on https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=clock https://jend.leeeet.dev/definition.txt?path=bend-kit-hairpin@0.13.0.1/hairpin.bend&name=deadline.some https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Jar https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Pool https://jend.leeeet.dev/definition.txt?path=bend-kit-retry@0.3.0.0/retry.bend&name=admit