Class MemcachedLock<K,V>

java.lang.Object
com.landawn.abacus.util.MemcachedLock<K,V>
Type Parameters:
K - the key type
V - the value type

public final class MemcachedLock<K,V> extends Object
Since:
0.8
Author:
Haiyang Li
  • Constructor Details

    • MemcachedLock

      public MemcachedLock(String serverUrl)
      Parameters:
      serverUrl -
  • Method Details

    • lock

      public boolean lock(K target, long liveTime)
      Parameters:
      target -
      liveTime -
      Returns:
    • lock

      public boolean lock(K target, V value, long liveTime)
      Parameters:
      target -
      value -
      liveTime - unit is milliseconds
      Returns:
    • isLocked

      public boolean isLocked(K target)
      Checks if is locked.
      Parameters:
      target -
      Returns:
      true, if is locked
    • get

      public V get(K target)
      Parameters:
      target -
      Returns:
    • unlock

      public boolean unlock(K target)
      Parameters:
      target -
      Returns:
    • client

      public SpyMemcached<V> client()
      Returns: