src/runtime.bend relies on unsafe/foreign
raw source on the hub · import bend-kube-runtime@0.8.1.0/src/runtime.bend as Runtime
15 imports
import Base import ./json.bend as J import ./utf8.bend as U import ./http.bend as H import ./core.bend as C import ./config.bend as K import ./net.bend as N import ./client.bend as Cl import ./watcher.bend as W import ./store.bend as S import ./queue.bend as Q import ./log.bend as L import ./control.bend as X import ./time.bend as T import ./sys.bend as Y
Types
type Msg source · line 31 · raw
Data
MOuts@src:U32 -> @outs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Out> -> Msg
MDone@key:String -> @act:0xb8480759a6c549cc21905c5dfd719065/src/queue.Action -> @ms:U32 -> Msg
MWake@key:String -> @at:U32 -> Msg
MStop@reply:Chan(Unit) -> Msg
MTickMsg
type Snap source · line 39 · raw
Data
The controller's state as the health server reports it.
Snap@name:String -> @ready:Bool -> @reconciles:U32 -> @errors:U32 -> @events:U32 -> @running:U32 -> @objects:U32 -> @queued:U32 -> @hist:List<&2, U32> -> @sum:Sum -> @cached:List<&2, U32> -> Snap
type SMsg source · line 46 · raw
Data
The status keeper's inbox: a controller's latest snapshot (by its index), or a query for all of them (none until a controller runs: a standby replica).
SPut@idx:U32 -> @snap:Snap -> SMsg
SGet@reply:Chan(List<&2, Snap>) -> SMsg
type Sum source · line 52 · raw
Data
A total of milliseconds, as whole seconds and the rest, so it lasts 136 years rather than 49 days.
Sum@secs:U32 -> @ms:U32 -> Sum
type Stats source · line 73 · raw
Data
Counters since start; hist counts reconciles by duration (Hist.bounds), sum is their total time.
Stats@reconciles:U32 -> @errors:U32 -> @events:U32 -> @hist:List<&2, U32> -> @sum:Sum -> Stats
type Sub source · line 87 · raw
Data
Who a watcher feeds: each subscriber's inbox, and the source number the outputs carry there (0 for a controller's primary, 1.. for its owned).
Sub@chan:Chan(Msg) -> @src:U32 -> Sub
type WCtx source · line 90 · raw
Data
WCtx@cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @api:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> @label:String -> @field:String -> @subs:List<&2, Sub> -> WCtx
type DEv source · line 94 · raw
Type
What the driver just saw.
DStartDEv
DListed@r:Result<&2, &2, 0xb8480759a6c549cc21905c5dfd719065/src/client.KErr, 0xb8480759a6c549cc21905c5dfd719065/src/json.Json> -> DEv
DOpened@r:Result<&1, &1, Pair(U32, String), 0xb8480759a6c549cc21905c5dfd719065/src/net.Tls> -> DEv
DRecv@sock:Socket -> @r:Result<&1, &1, Pair(U32, String), List<&2, U32>> -> DEv
DDig@sock:Socket -> @dig:Dig -> DEv
DStepped@step:0xb8480759a6c549cc21905c5dfd719065/src/watcher.Step -> @sock:Maybe<&1, Socket> -> @more:Bool -> DEv
DNext@sock:Maybe<&1, Socket> -> @wait:Bool -> @more:Bool -> DEv
type Dig source · line 131 · raw
Data
After a recv: the stream's state, and the step its whole lines make.
Dig@step:0xb8480759a6c549cc21905c5dfd719065/src/watcher.Step -> @resp:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @carry:List<&2, U32> -> @more:Bool -> @why:String -> Dig
type Tim source · line 388 · raw
Data
The controller's clock: each key's pending wake (its deadline in wall ms, and the queue generation it carries), the time of the message being handled, when a status snapshot was last published (and its readiness), whether anything happened since, whether a publish tick is pending, and which watches (by source number) are midway through a relist.
Tim@at:Map<&2, U32> -> @gen:Map<&2, U32> -> @now:U32 -> @snap:U32 -> @ready:Bool -> @dirty:Bool -> @tick:Bool -> @relist:Map<&2, U32> -> Tim
type CState source · line 395 · raw
Data
CState@store:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @caches:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @queue:0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue -> @stats:Stats -> @stop:Maybe<&2, Chan(Unit)> -> @tim:Tim -> @maps:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> CState
type Dog source · line 401 · raw
Data
The watchdog's inbox: a reconcile of key started at t0 (monotonic ms), or ended.
WdStart@key:String -> @t0:U32 -> Dog
WdEnd@key:String -> Dog
type CCtx source · line 405 · raw
Data
CCtx@cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @spec:0xb8480759a6c549cc21905c5dfd719065/src/control.Spec -> @chan:Chan(Msg) -> @status:Chan(SMsg) -> @idx:U32 -> @meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> @dog:Maybe<&2, Chan(Dog)> -> CCtx
type Job source · line 410 · raw
Data
A reconcile to start: the key and the object the store holds for it.
Job@key:String -> @obj:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @fails:U32 -> Job
type CEv source · line 414 · raw
Type
What the controller loop just saw.
CMsg@m:Maybe<&1, Msg> -> CEv
CTimed@m:Msg -> @now:U32 -> CEv
CHandled@r:Pair(CState, List<&2, Sleep>) -> CEv
CDisp@r:Pair(CState, List<&2, Job>) -> CEv
CNext@halt:Maybe<&2, Chan(Unit)> -> CEv
CPeek@p:Poll<&1, &1, Maybe<&1, Msg>, Unit> -> CEv
type Disp source · line 660 · raw
Data
A dispatch pass: the queue, the jobs to start, and whether a popped key was gone from the store (its slot freed, so another pass may start more).
Disp@queue:0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue -> @jobs:List<&2, Job> -> @dropped:Bool -> Disp
type Sleep source · line 680 · raw
Data
A sleeper to start: wake key after ms, naming its deadline.
Sleep@key:String -> @due:U32 -> @ms:U32 -> Sleep
type Idle source · line 854 · raw
Data
What an idle loop does about its status: publish now (a second has passed, or readiness changed), arm one tick to publish when the second is up, or nothing (nothing changed, or a tick is already armed).
IPubIdle
ITickIdle
INoneIdle
type DogEv source · line 1057 · raw
Type
DWaitDogEv
DGot@p:Poll<&1, &1, Maybe<&1, Dog>, Unit> -> DogEv
DTimeDogEv
DNow@now:U32 -> DogEv
DLate@key:Maybe<&2, String> -> DogEv
type Ctrl source · line 1402 · raw
Data
The older way to name a controller: a primary with a label selector, the kinds it owns, and how many reconciles run at once (X.Spec says more).
Ctrl@primary:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> @label:String -> @owned:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/core.Api> -> @max:U32 -> Ctrl
type Watch source · line 1426 · raw
Data
A watch: what, with which label and field selectors, on which cluster (None: the controllers' own), for whom.
Watch@api:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> @label:String -> @field:String -> @cluster:Maybe<&2, 0xb8480759a6c549cc21905c5dfd719065/src/config.Config> -> @subs:List<&2, Sub> -> Watch
type Asked source · line 1549 · raw
Data
The stop requests delivered, and whether every controller took one.
Asked@rs:List<&2, Chan(Unit)> -> @all:Bool -> Asked
Definitions
def Sum.add source · line 55 · raw
@x:Sum -> @+ms:U32 -> Sum
def Sum.sane.go source · line 60 · raw
@+ms:U32 -> @ok:Bool -> U32
def Sum.sane source · line 68 · raw
@+ms:U32 -> U32
A duration of a day or more (a sleeping laptop) counts as 0.
def Loop.spent source · line 78 · raw
@name:String -> IO(Unit)
A loop that used up its steps (2^64: never, in practice) exits, so the pod restarts, rather than leaving the process up and idle.
def DEv.recv source · line 103 · raw
@p:Pair(Socket, Result<&1, &1, Pair(U32, String), List<&2, U32>>) -> DEv
def Drv.inputs source · line 109 · raw
@ls:List<&2, List<&2, U32>> -> List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Input>
The inputs a run of watch lines makes; blank lines are skipped.
def Drv.inputs.par source · line 121 · raw
@+depth:Nat -> @+ls:List<&2, List<&2, U32>> -> List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Input>
The same, with the lines decoded and parsed in parallel: each line is its own JSON document, so the halves split (to depth levels, up to 2^depth tasks) run as Bend parallel calls, on every core.
def Drv.status source · line 134 · raw
@r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> U32
def Drv.ended source · line 141 · raw
@r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> Bool
def Drv.end_input source · line 156 · raw
@r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Input
How a watch stream ended: a whole response (the server's timeout) is an orderly end, resumed at once; a cut-off or broken one (a server or load balancer closing mid-stream or before answering) is a failure, which backs off, so a flapping server is not hammered.
def Drv.digest.end.go source · line 163 · raw
@st:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> @outs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Out> -> @+wait:Bool -> @+r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @carry:List<&2, U32> -> @+end:Bool -> Dig
def Drv.digest.end source · line 176 · raw
@s:0xb8480759a6c549cc21905c5dfd719065/src/watcher.Step -> @r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @carry:List<&2, U32> -> @+end:Bool -> Dig
A stream that ended cleanly is a watch timeout: the watcher resumes.
def Drv.digest.fin source · line 181 · raw
@st:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> @r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @cl:Pair(List<&2, U32>, List<&2, List<&2, U32>>) -> @+end:Bool -> Dig
def Drv.digest.lines source · line 188 · raw
@st:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> @rb:Pair(0xb8480759a6c549cc21905c5dfd719065/src/http.Resp, List<&2, U32>) -> @carry:List<&2, U32> -> @+eof:Bool -> Dig
def Drv.refused source · line 195 · raw
@r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> String
What the server said when it refused a watch: its status and reason.
def Drv.digest.ok source · line 202 · raw
@st:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> @+r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @carry:List<&2, U32> -> @+eof:Bool -> @+code:U32 -> @ok:Bool -> Dig
def Drv.digest.go source · line 210 · raw
@st:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> @r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @carry:List<&2, U32> -> @+eof:Bool -> @+code:U32 -> Dig
def Drv.digest source · line 213 · raw
@st:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> @+r:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @carry:List<&2, U32> -> @+eof:Bool -> Dig
def Drv.send source · line 216 · raw
@chan:Chan(Msg) -> @+src:U32 -> @outs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Out> -> IO(Unit)
def Drv.send_all source · line 225 · raw
@subs:List<&2, Sub> -> @+outs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Out> -> IO(Unit)
Hands the outputs to every subscriber (a shared watch fans out).
def Drv.jitter source · line 232 · raw
@+ms:U32 -> @r:Result<&1, &1, Pair(U32, String), U32> -> U32
def Drv.pause.go source · line 239 · raw
@+ms:U32 -> @+fails:U32 -> @path:String -> @server:String -> IO(Unit)
def Drv.pause source · line 245 · raw
@wait:Bool -> @+fails:U32 -> @path:String -> @server:String -> IO(Unit)
Sleeps the watcher's backoff, with up to 50% jitter, when asked to.
def Drv.note_list source · line 254 · raw
@first:Bool -> @path:String -> @server:String -> IO(Unit)
A list from its first page (startup, or a relist after 410 Gone).
def Drv.why source · line 261 · raw
@e:Pair(U32, String) -> String
def Drv.close source · line 266 · raw
@s:Maybe<&1, Socket> -> IO(Unit)
def WState.fails source · line 273 · raw
@s:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> U32
def WCtx.list_req source · line 278 · raw
@c:WCtx -> @cont:String -> 0xb8480759a6c549cc21905c5dfd719065/src/http.Req
def WCtx.watch_req source · line 283 · raw
@c:WCtx -> @rv:String -> 0xb8480759a6c549cc21905c5dfd719065/src/http.Req
def WCtx.path source · line 288 · raw
@c:WCtx -> String
def WCtx.server source · line 294 · raw
@c:WCtx -> String
The API server this watch talks to, for its logs.
def WCtx.cfg source · line 299 · raw
@c:WCtx -> 0xb8480759a6c549cc21905c5dfd719065/src/config.Config
def WCtx.subs source · line 304 · raw
@c:WCtx -> List<&2, Sub>
def Drv.run source · line 311 · raw
@outer:Nat -> @fuel:Nat -> @ev:DEv -> @+st:0xb8480759a6c549cc21905c5dfd719065/src/watcher.WState -> @+resp:0xb8480759a6c549cc21905c5dfd719065/src/http.Resp -> @+carry:List<&2, U32> -> @+ctx:WCtx -> IO(Unit)
The watcher's loop: list, then watch and stream, reconnecting and relisting as the state machine says, until the fuel or the channel ends.
def Tim.new source · line 392 · raw
Tim
def Caches.nth source · line 422 · raw
@cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @n:Nat -> 0xb8480759a6c549cc21905c5dfd719065/src/store.Store
def Caches.set source · line 431 · raw
@cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @n:Nat -> @x:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store>
def Caches.sizes source · line 440 · raw
@cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> List<&2, U32>
def Caches.ready source · line 447 · raw
@cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> Bool
def Secs.drop source · line 454 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Sec> -> @n:Nat -> List<&2, String>
def Secs.preds source · line 463 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Sec> -> @n:Nat -> List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Pred>
def Secs.rel source · line 472 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Sec> -> @n:Nat -> 0xb8480759a6c549cc21905c5dfd719065/src/control.Rel
def Hist.bounds source · line 486 · raw
List<&2, U32>
Reconcile durations: upper bounds in ms, as Prometheus' default buckets (5ms to 10s); the last count is everything slower.
def Hist.zero source · line 489 · raw
List<&2, U32>
def Hist.fits source · line 493 · raw
@bs:List<&2, U32> -> @+ms:U32 -> Bool
Whether ms falls in the first bucket of bs (the overflow when none is left).
def Hist.bump.go source · line 500 · raw
@cs:List<&2, U32> -> @bs:List<&2, U32> -> @+ms:U32 -> @hit:Bool -> List<&2, U32>
def Hist.bump source · line 511 · raw
@cs:List<&2, U32> -> @+ms:U32 -> List<&2, U32>
def Stats.events source · line 517 · raw
@x:Stats -> @+n:U32 -> Stats
def Stats.done source · line 522 · raw
@x:Stats -> @a:0xb8480759a6c549cc21905c5dfd719065/src/queue.Action -> @+ms:U32 -> Stats
def Ctl.prim.put source · line 531 · raw
@cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @q:0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue -> @x:Stats -> @p:Maybe<&2, Chan(Unit)> -> @tm:Tim -> @mq:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @f:0xb8480759a6c549cc21905c5dfd719065/src/control.Fold -> CState
def Ctl.rel.split source · line 537 · raw
@+n:Nat -> @s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @c:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @q:0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue -> @x:Stats -> @p:Maybe<&2, Chan(Unit)> -> @tm:Tim -> @mq:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @sp:0xb8480759a6c549cc21905c5dfd719065/src/control.Split -> CState
def Ctl.rel.put source · line 546 · raw
@+n:Nat -> @s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @q:0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue -> @x:Stats -> @p:Maybe<&2, Chan(Unit)> -> @tm:Tim -> @mq:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @f:0xb8480759a6c549cc21905c5dfd719065/src/control.Fold -> CState
A related watch's fold: its cache, the keys it triggers, and the objects its relation leaves to the controller's mapper (RMap), kept for after the fold (Ctl.map_all).
def Relist.after source · line 556 · raw
@os:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Out> -> @open:Bool -> Bool
Outputs of watch src: the primary's (0) through its predicates, a related watch's (n) through its relation. Whether a watch is midway through a relist after a batch of its outputs: Init opens one, InitDone closes it.
def Relist.mark source · line 567 · raw
@st:CState -> @+src:U32 -> @open:Bool -> CState
def Relist.open source · line 574 · raw
@st:CState -> @+src:U32 -> Bool
def Relist.any source · line 582 · raw
@st:CState -> Bool
Whether any watch is midway through a relist: its cache still holds the old list, so no reconcile may start (a key from an early page would be looked up in the old cache and dropped).
def Ctl.on_outs.fold source · line 587 · raw
@st:CState -> @+src:U32 -> @+outs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Out> -> @+spec:0xb8480759a6c549cc21905c5dfd719065/src/control.Spec -> @own:Bool -> CState
def Ctl.on_outs source · line 601 · raw
@+st:CState -> @+src:U32 -> @+outs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/watcher.Out> -> @+spec:0xb8480759a6c549cc21905c5dfd719065/src/control.Spec -> @own:Bool -> CState
Outputs of watch src, folded (Ctl.on_outs.fold), with its relist state.
def Ctl.on_done source · line 604 · raw
@s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @x:Stats -> @p:Maybe<&2, Chan(Unit)> -> @tm:Tim -> @mq:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @r:Pair(0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>) -> Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
def Ctl.forget_gone source · line 612 · raw
@r:Pair(0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>) -> @+key:String -> @gone:Bool -> Pair(0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
A finished key whose object is gone (deleted while it ran or waited) is forgotten, so the queue keeps nothing for it.
def Ctl.cached source · line 620 · raw
@m:Maybe<&2, 0xb8480759a6c549cc21905c5dfd719065/src/json.Json> -> Bool
def Ctl.on_done.st source · line 627 · raw
@st:CState -> @+key:String -> @+a:0xb8480759a6c549cc21905c5dfd719065/src/queue.Action -> @+ms:U32 -> Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
def Ctl.on_wake.go source · line 634 · raw
@st:CState -> @+key:String -> @mine:Bool -> Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
def Tim.at source · line 642 · raw
@st:CState -> Map<&2, U32>
def Ctl.on_wake source · line 650 · raw
@+st:CState -> @+key:String -> @+due:U32 -> Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
A sleeper woke: if it is still the one for its key's pending wake (the same deadline), the wake fires with the latest generation; an older sleeper, outdone by an earlier wake, does nothing.
def Ctl.on_stop source · line 653 · raw
@st:CState -> @r:Chan(Unit) -> Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
def Ctl.ticked source · line 663 · raw
@st:CState -> CState
def Ctl.on_msg source · line 684 · raw
@st:CState -> @m:Msg -> @+spec:0xb8480759a6c549cc21905c5dfd719065/src/control.Spec -> Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
A message's effect on the state, and the timers it arms.
def Tim.sooner source · line 699 · raw
@+at:U32 -> @+now:U32 -> @+ms:U32 -> Bool
Whether a pending deadline at is no later than now + ms (an overdue one, whose sleeper is about to fire, is earlier).
def Tim.arm.go source · line 702 · raw
@t:Tim -> @+key:String -> @+g:U32 -> @+ms:U32 -> @pending:Bool -> @sooner:Bool -> @ss:List<&2, Sleep> -> Pair(Tim, List<&2, Sleep>)
def Tim.arm source · line 711 · raw
@t:Tim -> @tm:0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer -> @ss:List<&2, Sleep> -> Pair(Tim, List<&2, Sleep>)
def Tim.arm.pair source · line 717 · raw
@r:Pair(Tim, List<&2, Sleep>) -> @t:0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer -> Pair(Tim, List<&2, Sleep>)
def Tim.arm_all.go source · line 722 · raw
@ts:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer> -> @r:Pair(Tim, List<&2, Sleep>) -> Pair(Tim, List<&2, Sleep>)
def Ctl.plan.put source · line 729 · raw
@s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @q:0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue -> @x:Stats -> @p:Maybe<&2, Chan(Unit)> -> @mq:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @r:Pair(Tim, List<&2, Sleep>) -> Pair(CState, List<&2, Sleep>)
def Ctl.plan source · line 736 · raw
@r:Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>) -> Pair(CState, List<&2, Sleep>)
The queue's timers become the keys' wakes, and the sleepers to start.
def Ctl.at source · line 742 · raw
@st:CState -> @+now:U32 -> CState
The state at a message's arrival: the clock reads now.
def Ctl.dispatch.forget source · line 747 · raw
@r:Pair(0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>) -> @+key:String -> 0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue
def Ctl.dispatch.put source · line 752 · raw
@+key:String -> @m:Maybe<&2, 0xb8480759a6c549cc21905c5dfd719065/src/json.Json> -> @d:Disp -> Disp
def Ctl.dispatch.go source · line 760 · raw
@ks:List<&2, String> -> @+s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @d:Disp -> Disp
def Ctl.dispatch.pop source · line 767 · raw
@r:Pair(0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue, List<&2, String>) -> @+s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @jobs:List<&2, Job> -> Disp
def Ctl.dispatch.loop source · line 775 · raw
@fuel:Nat -> @+s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @d:Disp -> Disp
Passes until one drops no key: a key whose object is gone frees its slot for the keys behind it. Every pass that continues dropped a waiting key, so as many passes as keys wait (plus one) always suffice.
def Ctl.dispatch.wrap source · line 786 · raw
@s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @x:Stats -> @p:Maybe<&2, Chan(Unit)> -> @tm:Tim -> @mq:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @d:Disp -> Pair(CState, List<&2, Job>)
def Ctl.dispatch.ready source · line 792 · raw
@+s:0xb8480759a6c549cc21905c5dfd719065/src/store.Store -> @cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/store.Store> -> @+q:0xb8480759a6c549cc21905c5dfd719065/src/queue.Queue -> @x:Stats -> @p:Maybe<&2, Chan(Unit)> -> @tm:Tim -> @mq:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @ready:Bool -> Pair(CState, List<&2, Job>)
def Ctl.stopping source · line 801 · raw
@p:Maybe<&2, Chan(Unit)> -> Bool
def Ctl.dispatch source · line 810 · raw
@st:CState -> Pair(CState, List<&2, Job>)
The reconciles to start now: none until every cache has its first list, none while a watch is midway through a relist, and none once stopping.
def Ctl.halt.go source · line 817 · raw
@p:Maybe<&2, Chan(Unit)> -> @idle:Bool -> Maybe<&2, Chan(Unit)>
def Ctl.halt source · line 825 · raw
@st:CState -> Maybe<&2, Chan(Unit)>
Whose stop request to answer: a stopping controller with nothing running.
def Ctl.ready source · line 830 · raw
@st:CState -> Bool
def Ctl.snap_due source · line 835 · raw
@st:CState -> Bool
def Ctl.ticking source · line 841 · raw
@st:CState -> CState
def Ctl.tick_pending source · line 846 · raw
@st:CState -> Bool
def Ctl.idle.go source · line 859 · raw
@dirty:Bool -> @due:Bool -> @pending:Bool -> Idle
def Ctl.dirty source · line 868 · raw
@st:CState -> Bool
def Ctl.idle source · line 873 · raw
@+st:CState -> Idle
def Ctl.snapped source · line 876 · raw
@st:CState -> CState
def Ctl.snap source · line 881 · raw
@st:CState -> @name:String -> Snap
def CCtx.status source · line 887 · raw
@c:CCtx -> Chan(SMsg)
def CCtx.idx source · line 892 · raw
@c:CCtx -> U32
def CCtx.spec source · line 897 · raw
@c:CCtx -> 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec
def CCtx.meter source · line 902 · raw
@c:CCtx -> Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter)
def CCtx.kind source · line 907 · raw
@c:CCtx -> String
def Ctl.name source · line 910 · raw
@+c:CCtx -> String
def Ctl.publish source · line 916 · raw
@+st:CState -> @+ctx:CCtx -> @due:Bool -> IO(CState)
Publishes a status snapshot at most once a second, whenever readiness changes, and when the loop goes idle with changes unpublished (a snapshot walks the cache to count it).
def CCtx.chan source · line 925 · raw
@c:CCtx -> Chan(Msg)
def Ctl.at_idle source · line 931 · raw
@+st:CState -> @+ctx:CCtx -> @i:Idle -> IO(CState)
At idle: publish, or arm the tick, then wait for the next message.
def Ctl.jitter.sat source · line 946 · raw
@+ms:U32 -> @+j:U32 -> @over:Bool -> U32
Up to 10% more for a delay of a second or more, so requeues armed together (a relist, a restart) spread out.
def Ctl.jitter.at source · line 953 · raw
@+ms:U32 -> @+j:U32 -> U32
def Ctl.jitter source · line 958 · raw
@+ms:U32 -> @r:Result<&1, &1, Pair(U32, String), U32> -> U32
ms with up to 10% more, saturating rather than wrapping: a requeue near 2^32 ms stays the longest wait, not a random short one.
def Ctl.delay source · line 965 · raw
@+ms:U32 -> @long:Bool -> IO(U32)
def Ctl.sleeps source · line 973 · raw
@ss:List<&2, Sleep> -> @+chan:Chan(Msg) -> IO(Unit)
def CCtx.dog source · line 985 · raw
@c:CCtx -> Maybe<&2, Chan(Dog)>
def CCtx.cfg source · line 990 · raw
@c:CCtx -> 0xb8480759a6c549cc21905c5dfd719065/src/config.Config
def Ctl.ctx source · line 996 · raw
@st:CState -> @+c:CCtx -> 0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx
What a reconcile sees: the config, the controller's index and the caches.
def Ctl.report source · line 1002 · raw
@+key:String -> @+kind:String -> @a:0xb8480759a6c549cc21905c5dfd719065/src/queue.Action -> IO(Unit)
def Ctl.mono source · line 1017 · raw
IO(U32)
The monotonic clock in ms (never stepped; it wraps every 49.7 days, which the wrapped subtractions handle): requeue deadlines and reconcile durations are measured by it.
def Dog.over.go source · line 1029 · raw
@+d:U32 -> @+to:U32 -> Bool
def Dog.over source · line 1035 · raw
@+now:U32 -> @+t0:U32 -> @+to:U32 -> Bool
Whether a reconcile started at t0 has run past to ms at now. Wrap-safe: a start that reads as later than now (a difference of 2^31 ms or more) has not run at all.
def Dog.pick source · line 1038 · raw
@+k:String -> @hit:Bool -> @rest:Maybe<&2, String> -> Maybe<&2, String>
def Dog.late.go source · line 1045 · raw
@ks:List<&2, String> -> @+m:Map<&2, U32> -> @+now:U32 -> @+to:U32 -> Maybe<&2, String>
def Dog.late source · line 1054 · raw
@+running:Map<&2, U32> -> @+now:U32 -> @+to:U32 -> Maybe<&2, String>
A running reconcile past its timeout, if any: running maps keys to their start times.
def Dog.run source · line 1064 · raw
@outer:Nat -> @fuel:Nat -> @ev:DogEv -> @+running:Map<&2, U32> -> @+to:U32 -> @+inbox:Chan(Dog) -> @+kind:String -> IO(Unit)
def Dog.start.go source · line 1093 · raw
@+to:U32 -> @+kind:String -> @off:Bool -> IO(Maybe<&2, Chan(Dog)>)
def Dog.start source · line 1105 · raw
@+to:U32 -> @+kind:String -> IO(Maybe<&2, Chan(Dog)>)
The watchdog of a controller whose reconciles time out after to ms (0: none, and no watchdog).
def Ctl.job.end source · line 1108 · raw
@+key:String -> @+a:0xb8480759a6c549cc21905c5dfd719065/src/queue.Action -> @+t0:U32 -> @+kind:String -> @+chan:Chan(Msg) -> IO(Result<&1, &1, Msg, Unit>)
def CState.maps source · line 1165 · raw
@st:CState -> List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped>
def Ctl.map_put source · line 1185 · raw
@st:CState -> @ks:List<&2, String> -> CState
def Ctl.watch.subs source · line 1238 · raw
@+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @api:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> @label:String -> @field:String -> @subs:List<&2, Sub> -> IO(Unit)
def Api.kind source · line 1243 · raw
@a:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> String
def Keeper.all.put source · line 1248 · raw
@r:Pair(Map<&2, Snap>, Snap) -> @rest:List<&2, Snap> -> List<&2, Snap>
def Keeper.all.go source · line 1253 · raw
@ks:List<&2, String> -> @+m:Map<&2, Snap> -> List<&2, Snap>
def Keeper.all source · line 1261 · raw
@+m:Map<&2, Snap> -> List<&2, Snap>
def Keeper.run source · line 1266 · raw
@outer:Nat -> @fuel:Nat -> @m:Maybe<&1, SMsg> -> @+last:Map<&2, Snap> -> @+inbox:Chan(SMsg) -> IO(Unit)
The status keeper: holds each controller's latest snapshot and answers queries at once.
def Keeper.start source · line 1283 · raw
IO(Chan(SMsg))
Starts a status keeper; answers its inbox.
def Controller.inbox source · line 1305 · raw
IO(Chan(Msg))
def Meter.key source · line 1314 · raw
@+name:String -> @+labels:String -> @none:Bool -> String
def Meter.kind source · line 1321 · raw
@k:U32 -> String
def Meter.sample source · line 1328 · raw
@+k:String -> @mine:Bool -> @+vals:Map<&2, U32> -> String
def Meter.samples source · line 1335 · raw
@ks:List<&2, String> -> @+name:String -> @+vals:Map<&2, U32> -> String
def Meter.render.go source · line 1343 · raw
@ns:List<&2, String> -> @+vals:Map<&2, U32> -> @+kinds:Map<&2, U32> -> String
def Meter.render source · line 1352 · raw
@+vals:Map<&2, U32> -> @+kinds:Map<&2, U32> -> String
Every series, family by family, in the Prometheus text format.
def Meter.run source · line 1355 · raw
@outer:Nat -> @fuel:Nat -> @m:Maybe<&1, 0xb8480759a6c549cc21905c5dfd719065/src/control.Meter> -> @+vals:Map<&2, U32> -> @+kinds:Map<&2, U32> -> @+inbox:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(Unit)
def Meter.start source · line 1383 · raw
IO(Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter))
Starts the meter; answers its inbox.
def Ctrl.owns source · line 1405 · raw
@os:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/core.Api> -> @s:0xb8480759a6c549cc21905c5dfd719065/src/control.Spec -> 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec
def Ctrl.spec source · line 1412 · raw
@c:Ctrl -> 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec
def Ctrl.specs source · line 1417 · raw
@cs:List<&2, Ctrl> -> List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec>
def Watch.at source · line 1429 · raw
@m:Maybe<&2, 0xb8480759a6c549cc21905c5dfd719065/src/config.Config> -> String
def Watch.key source · line 1438 · raw
@+api:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> @+label:String -> @+field:String -> @+cl:Maybe<&2, 0xb8480759a6c549cc21905c5dfd719065/src/config.Config> -> String
Two watches are one when they ask the same cluster, as the same user, for the same objects.
def Plan.hit source · line 1441 · raw
@ws:List<&2, Watch> -> @+key:String -> Bool
def Plan.add source · line 1449 · raw
@ws:List<&2, Watch> -> @+api:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> @+label:String -> @+field:String -> @+cl:Maybe<&2, 0xb8480759a6c549cc21905c5dfd719065/src/config.Config> -> @+sub:Sub -> @hit:Bool -> List<&2, Watch>
Adds a subscription: to the watch of the same key, or as a new watch.
def Plan.sub source · line 1459 · raw
@+ws:List<&2, Watch> -> @+api:0xb8480759a6c549cc21905c5dfd719065/src/core.Api -> @+label:String -> @+field:String -> @+cl:Maybe<&2, 0xb8480759a6c549cc21905c5dfd719065/src/config.Config> -> @+sub:Sub -> List<&2, Watch>
def Plan.secs source · line 1463 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Sec> -> @+ch:Chan(Msg) -> @+n:U32 -> @ws:List<&2, Watch> -> List<&2, Watch>
def Plan.build source · line 1471 · raw
@cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec> -> @chs:List<&2, Chan(Msg)> -> @ws:List<&2, Watch> -> List<&2, Watch>
Every watch the controllers need, each once, with all its subscribers.
def Manager.inboxes source · line 1478 · raw
@+n:Nat -> IO(List<&2, Chan(Msg)>)
def Manager.watch source · line 1487 · raw
@+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @ws:List<&2, Watch> -> IO(Unit)
def Manager.no_map source · line 1527 · raw
@n:U32 -> @o:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @c:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>
No mapper: an RMap relation then names no primary.
def Manager.gate source · line 1540 · raw
IO(Chan(Unit))
The start gate: one token, taken by whichever comes first, the controllers starting (Manager.start) or shutdown (Manager.stop). So shutdown either knows they run and drains them, or keeps them from ever starting.
def Stop.ask.put source · line 1552 · raw
@p:Poll<&1, &1, Result<&1, &1, Msg, Unit>, Msg> -> @+r:Chan(Unit) -> @a:Asked -> Asked
def Stop.ask source · line 1561 · raw
@chs:List<&2, Chan(Msg)> -> IO(Asked)
Asks each controller to stop; one whose inbox does not take the request within a second makes the drain unclean (its reconciles may go on).
def Stop.wait source · line 1571 · raw
@rs:List<&2, Chan(Unit)> -> IO(Unit)
def Stop.said source · line 1579 · raw
@m:Maybe<&1, Bool> -> IO(Bool)
Whether every controller took the stop request and finished in time.
def Stop.all.of source · line 1592 · raw
@a:Asked -> IO(Bool)
def Stop.all source · line 1597 · raw
@chs:List<&2, Chan(Msg)> -> IO(Bool)
def Stop.drain source · line 1602 · raw
@chs:List<&2, Chan(Msg)> -> @+grace:U32 -> @p:Poll<&1, &1, Maybe<&1, Unit>, Unit> -> IO(Bool)
p: shutdown's attempt to take the start gate's token. Taking it means no controller started, nor ever will: nothing to drain. Otherwise they run.
def Manager.stop source · line 1615 · raw
@chs:List<&2, Chan(Msg)> -> @+gate:Chan(Unit) -> @+grace:U32 -> IO(Bool)
Asks every running controller to stop: no new reconciles start, and this returns once the running ones finish, or after grace ms. Nothing to do when the controllers never started (a standby replica). Answers whether nothing is left running.
Templates
template Ctl.guarded source · line 1114 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @+key:String -> @o:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @+ctx:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> @+d:Chan(Dog) -> @+t0:U32 -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)
template Ctl.call source · line 1124 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @+key:String -> @o:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @+ctx:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> @dog:Maybe<&2, Chan(Dog)> -> @+t0:U32 -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)
The reconcile itself, watched by the controller's watchdog when it has a timeout. A reconcile that outlives it exits the process: it cannot be cancelled, and freeing its key while it runs would run the key twice.
template Ctl.job.go source · line 1132 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @+key:String -> @o:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @+ctx:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> @+kind:String -> @+chan:Chan(Msg) -> @+dog:Maybe<&2, Chan(Dog)> -> @+t0:U32 -> IO(Result<&1, &1, Msg, Unit>)
template Ctl.job source · line 1138 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @+key:String -> @o:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @+ctx:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> @+kind:String -> @+chan:Chan(Msg) -> @+dog:Maybe<&2, Chan(Dog)> -> IO(Result<&1, &1, Msg, Unit>)
A reconcile, timed; a failure is logged; MDone answers on the channel.
template Ctl.spawn source · line 1145 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @jobs:List<&2, Job> -> @+chan:Chan(Msg) -> @+ctx:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> @+kind:String -> @+dog:Maybe<&2, Chan(Dog)> -> IO(Unit)
Starts a reconcile per job, each with the caches and its key's failure count; each answers MDone on the channel.
template Ctl.map_parsed source · line 1170 · raw
@-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @+n:U32 -> @r:Result<&2, &2, String, 0xb8480759a6c549cc21905c5dfd719065/src/json.Json> -> @+c:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>
template Ctl.map_keys source · line 1178 · raw
@-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @ms:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Mapped> -> @+c:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>
template Ctl.map_all source · line 1190 · raw
@-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @+st:CState -> @+c:CCtx -> CState
template Ctl.mapped source · line 1193 · raw
@-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @r:Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>) -> @+c:CCtx -> Pair(CState, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/queue.Timer>)
template Ctl.run source · line 1201 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @outer:Nat -> @fuel:Nat -> @ev:CEv -> @+st:CState -> @+ctx:CCtx -> IO(Unit)
The controller loop: a message in, the state stepped, timers armed, reconciles started, the next message awaited; a stop request is answered once nothing runs, and ends the loop.
template Ctl.loop.go source · line 1289 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @+spec:0xb8480759a6c549cc21905c5dfd719065/src/control.Spec -> @+chan:Chan(Msg) -> @+status:Chan(SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> @+idx:U32 -> @dog:Maybe<&2, Chan(Dog)> -> IO(Unit)
template Ctl.loop source · line 1300 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @+spec:0xb8480759a6c549cc21905c5dfd719065/src/control.Spec -> @+chan:Chan(Msg) -> @+status:Chan(SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> @+idx:U32 -> IO(Unit)
template Manager.loops source · line 1494 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec> -> @chs:List<&2, Chan(Msg)> -> @+status:Chan(SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> @+i:U32 -> IO(Unit)
template Manager.start.go source · line 1506 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @+cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec> -> @+chs:List<&2, Chan(Msg)> -> @+status:Chan(SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> @p:Poll<&1, &1, Maybe<&1, Unit>, Unit> -> IO(Unit)
Runs every controller on its inbox (Manager.inboxes), sharing their watches. rec(obj, ctx) reconciles obj; X.Ctx.idx(ctx) names the controller.
template Manager.start_mapped source · line 1520 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @-map:(@_:U32 -> @_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> List<&2, String>) -> @+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @+cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec> -> @+chs:List<&2, Chan(Msg)> -> @+status:Chan(SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> @+gate:Chan(Unit) -> IO(Unit)
Runs every controller on its inbox (Manager.inboxes), sharing their watches, once it takes the start gate's token (Manager.gate): shutdown takes it first when it comes first, and then nothing starts. rec(obj, ctx) reconciles obj; X.Ctx.idx(ctx) names the controller.
template Manager.start source · line 1531 · raw
@-rec:(@_:0xb8480759a6c549cc21905c5dfd719065/src/json.Json -> @_:0xb8480759a6c549cc21905c5dfd719065/src/control.Ctx -> IO(0xb8480759a6c549cc21905c5dfd719065/src/queue.Action)) -> @+cfg:0xb8480759a6c549cc21905c5dfd719065/src/config.Config -> @+cs:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/control.Spec> -> @+chs:List<&2, Chan(Msg)> -> @+status:Chan(SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> @+gate:Chan(Unit) -> IO(Unit)
Manager.start_mapped with no mapper (RMap relations name nothing).