def run
bend-kit-hairpin@0.14.0.0 · hairpin.bend:435
import bend-kit-hairpin@0.14.0.0/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.3.0.0/retry.bend as Retry
435def run(~R: Type, ~judge: Result<&1, &1, Http.Err, R> -> Result<&1, &1, Http.Err, R> & Verdict,
436 ~try: Opts -> Call -> Http.Pool -> Maybe<&2, Http.Jar> -> Bytes.Bytes -> IO(Http.Pool & Maybe<&2, Http.Jar> & Result<&1, &1, Http.Err, R>),
437 ~close: R -> IO(Unit),
438 c: Client, b: Retry.Budget, +idem: Bool, enc: String, method: String, url: String,
439 headers: Map<&2, List<&2, String>>, body: Bytes.Bytes) -> IO(Client & Retry.Budget & Result<&1, &1, Err, R>):
440 Client{+o, pool, jar, br} = c
441 Opts{+base, +h, ms, mode, +p, cert, ca} = o
442 +call = {Call{enc, method, target.abs(target(base, url)), merge(h, headers)} : Call}
443 do IO<Client & Retry.Budget & Result<&1, &1, Err, R>>:
444 s : Step<R> <- go(~R, ~judge, ~try, ~close, attempts(p), 0n, o, call, idem, Step{pool, jar, br, b, body, None{}, Retry.PlanWait{0n}})
445 return request.done(R, o, s)