def retry.start
bend-kit-http@0.38.5.0 · http.bend:4604
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
4604
4605
4606
4607
4608
4609def retry.start(enabled: Bool, n: U32, +method: String, +url: String,
4610 +headers: Map<&2, List<&2, String>>, body: Bytes.Bytes) ->
4611 IO(Result<&1, &1, Err, Res>):
4612 match enabled:
4613 case False{}:
4614 fetch(method, url, headers, body)
4615 case True{}:
4616 do IO<Result<&1, &1, Err, Res>>:
4617 first : Bytes.Bytes & Result<&1, &1, Err, Res> & Maybe<&2, String> <-
4618 retry.one(True{}, method, url, headers, Bytes.slice(body, 0, 4294967295))
4619 retry.go(U32.to_nat(n), 0n, True{}, method, url, headers, first)