Single, group, and strategic contracts
Latest stable Based on Leader release 0.4.0
Understand what each model guarantees—and what work partitioning remains outside the library.
Single
Section titled “Single”One lock name permits at most one compliant owner. The action is still at-least-once from a business perspective when leases expire or callers retry, so external effects need idempotency.
A group exposes up to maxLeaders independent slots and reports activeCount, availableSlots, and isFull. Slot ownership limits concurrency but does not assign unique work. Group event projections may omit the concrete leaders because revoke events do not always identify a slot.
Strategic
Section titled “Strategic”Strategic election separates candidate registration from winner selection. Built-ins include FIFO, seeded random, and scored selection with idle-time, success-rate, recent-success, and weighted scorers. It optimizes placement; it does not by itself provide a distributed lock for arbitrary shared writes.
Release sources
Section titled “Release sources”leader-core/README.mdleader-core/src/main/kotlin/io/bluetape4k/leader/LeaderGroupState.ktleader-core/src/main/kotlin/io/bluetape4k/leader/StrategicLeaderElector.kt