def retry.one

bend-kit-http@0.38.2.0 · http.bend:4572

import bend-kit-http@0.38.2.0/http.bend as Http
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

4572# One fetch of the copy; the body comes back for the next try.
4573def retry.one(+idem: Bool, +method: String, +url: String, +headers: Map<&2, List<&2, String>>,
4574    r: Bytes.Bytes & Bytes.Bytes) -> IO(Bytes.Bytes & Result<&1, &1, Err, Res> & Maybe<&2, String>):
4575  (body, spare) = r
4576  do IO<Bytes.Bytes & Result<&1, &1, Err, Res> & Maybe<&2, String>>:
4577    got : Result<&1, &1, Err, Res> <- fetch(method, url, headers, spare)
4578    return retry.kept(body, retry.judge(idem, got))

Uses (17)

Used by (2)