def fetch_all

cswap-bend-cli@0.1.0.0 · collectrun.bend:95

import cswap-bend-cli@0.1.0.0/collectrun.bend as Collectrun
import Base
import cswap-bend-cli@0.1.0.0/urec.bend as Urec

95def fetch_all(js: List<&2, Job>, +root: String, +models: List<&2, String>, +threshold: U32, +now: U32) -> IO(List<&2, Urec.Rec>):
96  match js:
97    case Nil{}:
98      IO.pure(List<&2, Urec.Rec>, [])
99    case Con{Job{st, None{}}, t}:
100      fetch_all(t, root, models, threshold, now)
101    case Con{Job{st, Some{claim}}, t}:
102      IO.bind(Urec.Rec, List<&2, Urec.Rec>, fetch_st(st, claim, root, models, threshold, now),
103        r => IO.bind(List<&2, Urec.Rec>, List<&2, Urec.Rec>, fetch_all(t, root, models, threshold, now), rest => IO.pure(List<&2, Urec.Rec>, r <> rest)))

Uses (10)

Used by (1)