def Leader.started
import bend-kube-runtime@0.2.0.0/src/leader.bend as Leaderimport Base
import bend-kube-runtime@0.2.0.0/src/log.bend as L
83# On first acquiring: log and start the work.
84def Leader.started(leading: Bool, start: Maybe<&1, IO(Unit)>) -> IO(Unit):
85 match leading start:
86 case False{} Some{act}:
87 IO.bind(Unit, Unit, L.Log.info("became leader", Nil{}), u => IO.spawn(Unit, act))
88 case _ _:
89 IO.pure(Unit, Unit{})