Interface DistributedLock
- All Known Implementing Classes:
InMemoryStores, RedisDistributedLock
public interface DistributedLock
Provides short-lived, owner-safe leases shared by orchestrator nodes.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA lock claim that releases only its own ownership token when closed. -
Method Summary
Modifier and TypeMethodDescriptiontryAcquire(String key, Duration duration) Attempts to claim a key for a bounded duration without waiting.
-
Method Details
-
tryAcquire
Attempts to claim a key for a bounded duration without waiting.- Parameters:
key- globally meaningful lock keyduration- lease lifetime- Returns:
- owned lease, or empty when another node owns the key
-