def send.with

bend-kit-webhooks@0.11.0.1 · webhooks.bend:497

import bend-kit-webhooks@0.11.0.1/webhooks.bend as Webhooks
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-hairpin@0.13.0.1/hairpin.bend as Hairpin
import bend-kit-retry@0.2.0.0/retry.bend as Retry
import bend-kit-http@0.38.1.1/http.bend as Http

497# n extra attempts, on a budget of n + 1 and the client's deadline, with Hairpin's backoff. The client comes back with retry n.
498def send.with(+n: U32, c: Hairpin.Client, url: String, id: String, secret: String, body: Bytes.Bytes) ->
499    IO(Hairpin.Client & Result<&1, &1, SendErr, Http.Res>):
500  do IO<Hairpin.Client & Result<&1, &1, SendErr, Http.Res>>:
501    y : Hairpin.Client & Retry.Budget <- Hairpin.budget(Hairpin.retry(c, n))
502    x : Hairpin.Client & Retry.Budget & Result<&1, &1, SendErr, Http.Res> <- send.budget(url, id, secret, body, y)
503    return send.drop(x)

Uses (16)

Used by (1)