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