Lease.Lease.decide: def of bend-kube-runtime@0.2.0.0 Import: import bend-kube-runtime@0.2.0.0/src/lease.bend as Lease Lines 111-119 of bend-kube-runtime@0.2.0.0/src/lease.bend: https://jend.leeeet.dev/read.txt?path=bend-kube-runtime@0.2.0.0/src/lease.bend&start_line=111&end_line=119 import Base import bend-kube-runtime@0.2.0.0/src/json.bend as J # One round: the Lease read (None when absent), us, what we saw before, # our clock in ms, the lease duration in seconds, and the time to stamp. def Lease.decide(cur: Maybe<&2, J.Json>, ns: String, name: String, +me: String, o: Obs, +now_ms: U32, +dur: U32, +now: String) -> Decision: match cur: case None{}: Decision{LCreate{Lease.fresh(ns, name, me, dur, now)}, Obs{me, now, now_ms}} case Some{+l}: Lease.decide.got(l, me, o, now_ms, dur, now) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 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/lease.bend&name=Decision https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/lease.bend&name=Lease.decide.got https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/lease.bend&name=Lease.fresh https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/lease.bend&name=LeaseAct https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/lease.bend&name=Obs