com.coralogix.zio.k8s.operator.leader

Type members

Classlikes

final case class ApplicationError[E](error: E) extends LeaderElectionFailure[E]

Inner effect failed

Inner effect failed

final case class ContextInfoError(error: ContextInfoFailure) extends LeaderElectionFailure[Nothing]

Failure while gathering information about the running service

Failure while gathering information about the running service

final case class DateTimeError(error: DateTimeException) extends LeaderElectionFailure[Nothing]

Failure while calling the Date-Time API

Failure while calling the Date-Time API

final case class KubernetesError(error: K8sFailure) extends LeaderElectionFailure[Nothing]

Failure while calling the Kubernetes API

Failure while calling the Kubernetes API

sealed trait LeaderElectionFailure[+E]

Possible failures of the leader election algorithm

Possible failures of the leader election algorithm

Type parameters:
E

Failure type of the inner effect

Common interface for different lock implementations used for leader election.

Common interface for different lock implementations used for leader election.

Value members

Concrete methods

Creates a managed lock implementing the leader election algorithm

Creates a managed lock implementing the leader election algorithm

def runAsLeader[R, E, A](f: ZIO[R, E, A]): ZIO[R & LeaderElection & 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 parameters:
f

Inner effect to protect