def retry.one

bend-kit-http@0.38.5.0 · http.bend:4576

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

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

Uses (17)

Used by (2)