def Ctl.timers

bend-kube-runtime@0.2.0.0 · src/runtime.bend:478

import bend-kube-runtime@0.2.0.0/src/runtime.bend as Runtime
import Base
import bend-kube-runtime@0.2.0.0/src/queue.bend as Q

478def Ctl.timers(ts: List<&2, Q.Timer>, +chan: Chan(Msg)) -> IO(Unit):
479  match ts:
480    case Nil{}:
481      IO.pure(Unit, Unit{})
482    case Con{Q.Timer{key, g, ms}, t}:
483      IO.bind(Unit, Unit,
484        IO.spawn(Result<&1, &1, Msg, Unit>,
485          IO.bind(Unit, Result<&1, &1, Msg, Unit>, IO.sleep(ms),
486            u => Chan.send(Msg, chan, MWake{key, g}))),
487        u => Ctl.timers(t, chan))

Uses (12)

Used by (1)