Service

trait Service
class Object
trait Matchable
class Any
class Live

Value members

Abstract methods

def lease: ZManaged[Clock & Logging, LeaderElectionFailure[Nothing], Unit]

Creates a managed lock implementing the leader election algorithm

Creates a managed lock implementing the leader election algorithm

Concrete methods

def runAsLeader[R, E, A](f: ZIO[R, E, A]): ZIO[R & Clock & Logging, E, Option[A]]

Runs the given effect by applying the leader election algorithm, with the guarantee that the inner effect will only run at once in the Kubernetes cluster.

Runs the given effect by applying the leader election algorithm, with the guarantee that the inner effect will only run at once in the Kubernetes cluster.

If you want to manage the lock as a ZManaged use lease

Value Params
f

Inner effect to protect