Runtime.Ctl.run: def of bend-kube-runtime@0.2.0.0 Import: import bend-kube-runtime@0.2.0.0/src/runtime.bend as Runtime Lines 527-546 of bend-kube-runtime@0.2.0.0/src/runtime.bend: https://jend.leeeet.dev/read.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&start_line=527&end_line=546 import Base import bend-kube-runtime@0.2.0.0/src/json.bend as J import bend-kube-runtime@0.2.0.0/src/config.bend as K import bend-kube-runtime@0.2.0.0/src/queue.bend as Q # The controller loop: a message in, the state stepped, timers armed, # reconciles started, the next message awaited. def Ctl.run(~rec: U32 -> J.Json -> K.Config -> IO(Q.Action), fuel: Nat, ev: CEv, +st: CState, +ctx: CCtx) -> IO(Unit): match fuel ev: case 0n e: IO.pure(Unit, Unit{}) case 1n+f CMsg{None{}}: IO.pure(Unit, Unit{}) case 1n+f CMsg{Some{m}}: Ctl.run(~rec, f, CHandled{Ctl.on_msg(st, m, CCtx.kind(ctx))}, st, ctx) case 1n+f CHandled{(+st1, ts)}: IO.bind(Unit, Unit, Ctl.timers(ts, CCtx.chan(ctx)), u => Ctl.run(~rec, f, CDisp{Ctl.dispatch(st1)}, st1, ctx)) case 1n+f CDisp{(+st2, jobs)}: IO.bind(Unit, Unit, Ctl.spawn(~rec, jobs, CCtx.chan(ctx), CCtx.cfg(ctx), CCtx.idx(ctx)), u => IO.bind(Result<&1, &1, SMsg, Unit>, Unit, Chan.send(SMsg, CCtx.status(ctx), SPut{CCtx.idx(ctx), Ctl.snap(st2, U32.show(CCtx.idx(ctx)) ++ "/" ++ CCtx.kind(ctx))}), u2 => IO.bind(Maybe<&1, Msg>, Unit, Chan.recv(Msg, CCtx.chan(ctx)), m => Ctl.run(~rec, f, CMsg{m}, st2, ctx)))) Uses (31): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Chan.recv https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Chan.send https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.show https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/config.bend&name=Config https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/json.bend&name=Json https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/queue.bend&name=Action https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CCtx https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CCtx.cfg https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CCtx.chan https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CCtx.idx https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CCtx.kind https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CCtx.status https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CEv https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=CState https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=Ctl.dispatch https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=Ctl.on_msg https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=Ctl.snap https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=Ctl.spawn https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=Ctl.timers https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=Msg https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/runtime.bend&name=SMsg