Package dev.cachly

Class CachlyClient.LockHandle

java.lang.Object
dev.cachly.CachlyClient.LockHandle
All Implemented Interfaces:
AutoCloseable
Enclosing class:
CachlyClient

public final class CachlyClient.LockHandle extends Object implements AutoCloseable
Handle returned by a successful CachlyClient.lock(java.lang.String, long, int, long) call. Call release() in a finally block to free the lock early.
  • Method Details

    • getToken

      public String getToken()
      Unique fencing token for this lock acquisition.
    • release

      public void release()
      Release the lock atomically. No-op if already expired or released.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable