def prefetch2

cswap-bend-cli@0.1.0.0 · swlive.bend:245

import cswap-bend-cli@0.1.0.0/swlive.bend as Swlive
import Base
import cswap-bend-cli@0.1.0.0/act.bend as Act
import cswap-bend-cli@0.1.0.0/swcreds.bend as C
import cswap-bend-cli@0.1.0.0/store/base.bend as SBase
import cswap-bend-cli@0.1.0.0/store/plan.bend as SPlan

245# `_prefetch_live_identity`: before any lock is taken, look the diverged live
246# credential up (the only network call of a switch).
247def prefetch2(+want: Bool, +o: Oracle, +live: String) -> Act.of(SPlan.Prof):
248  Act.cond(SPlan.Prof, want && SBase.nonempty(C.access_of(live)), Act.lift(SPlan.Prof, run_oracle(o, C.access_of(live))), Act.pure(SPlan.Prof, SPlan.ProfNone{}))

Uses (12)

Used by (1)