Lease.Lease.held: def of bend-kube-runtime@0.2.0.0 Import: import bend-kube-runtime@0.2.0.0/src/lease.bend as Lease Lines 75-81 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=75&end_line=81 import Base import bend-kube-runtime@0.2.0.0/src/json.bend as J # Whether another holder's lease is still live by our clock. def Lease.held(+l: J.Json, +me: String, o: Obs, +now: U32, +dur: U32) -> Bool: match o: case Obs{h, r, +at}: Bool.and(Bool.not(String.is_empty(Lease.holder(l))), Bool.and(Bool.not(String.eq(Lease.holder(l), me)), U32.is_lt((now - at : U32), (dur * 1000 : U32)))) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub 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=Lease.holder https://jend.leeeet.dev/definition.txt?path=bend-kube-runtime@0.2.0.0/src/lease.bend&name=Obs