def gate.pick

cswap-bend-cli@0.1.0.0 · usage.bend:160

import cswap-bend-cli@0.1.0.0/usage.bend as Usage
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/usage/cred.bend as UCred
import cswap-bend-cli@0.1.0.0/usage/gate.bend as UGate

160def gate.pick(needs: Bool, +gate: UGate.Gate, +cred: String, +o: Json.Json, +token: String, +active: Bool, +now: U32, +off: U32) -> IO(Fetched):
161  match needs:
162    case True{}:
163      IO.bind(UGate.Gated, Fetched, UGate.refresh_via(gate, cred), g => fetch.pre(g, gate, cred, o, token, active, now, off))
164    case False{}:
165      fetch.req(gate, cred, o, token, active, now, off, None{}, UCred.inference_only(o))

Uses (14)

Used by (1)