Http.retry.start: def of bend-kit-http@0.38.2.0 Import: import bend-kit-http@0.38.2.0/http.bend as Http Lines 4600-4615 of bend-kit-http@0.38.2.0/http.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-http@0.38.2.0/http.bend&start_line=4600&end_line=4615 import Base import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes # fetch.retry(n, method, url, headers, body) is fetch, tried again up to n times while an # idempotent method (GET, HEAD, OPTIONS, TRACE, PUT, DELETE) gets a connect error, a timeout, # or 408, 429, 500, 502, 503, or 504. POST, PATCH and other methods get one try. It waits # Retry-After (seconds or HTTP-date, at most 30 s) when given, else the backoff. When retries # run out, the last response or error comes back as it was. def retry.start(enabled: Bool, n: U32, +method: String, +url: String, +headers: Map<&2, List<&2, String>>, body: Bytes.Bytes) -> IO(Result<&1, &1, Err, Res>): match enabled: case False{}: fetch(method, url, headers, body) case True{}: do IO>: first : Bytes.Bytes & Result<&1, &1, Err, Res> & Maybe<&2, String> <- retry.one(True{}, method, url, headers, Bytes.slice(body, 0, 4294967295)) retry.go(U32.to_nat(n), 0n, True{}, method, url, headers, first) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Map https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=slice https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Err https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=Res https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=fetch https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=retry.go https://jend.leeeet.dev/definition.txt?path=bend-kit-http@0.38.2.0/http.bend&name=retry.one