/toolarium-leader-election

Implements the leader election api.

Primary LanguageJavaApache License 2.0Apache-2.0

License Maven Central javadoc

toolarium-leader-election

Implements the leader election api. The implementation supports kubernetes and jgroup binding.

Built With

  • cb - The toolarium common build

Versioning

We use SemVer for versioning. For the versions available, see the [tags on this repository].

Usage

// initialize
ILeaderElector leaderElector = LeaderElectionFactory.getInstance().getLeaderElection(
    new LeaderElectionInformation("namespace", "name", "test"), new LeaderElectionConfiguration(10 /* duration of 10 seconds */));

if (leaderElector.isLeader()) {
    // get in lead
} else {
    // not in lead
}