def Lease.observe

bend-kube-runtime@0.2.0.0 · src/lease.bend:67

import bend-kube-runtime@0.2.0.0/src/lease.bend as Lease
import Base
import bend-kube-runtime@0.2.0.0/src/json.bend as J

67# The record seen now: the old observation if nothing changed, else a new
68# one stamped now.
69def Lease.observe(+l: J.Json, o: Obs, +now: U32) -> Obs:
70  match o:
71    case Obs{+h, +r, at}:
72      Lease.observe.go(Lease.holder(l), Lease.renew_time(l), Obs{h, r, at}, now,
73        Bool.and(String.eq(h, Lease.holder(l)), String.eq(r, Lease.renew_time(l))))

Uses (8)

Used by (1)