K
- the key typeV
- the value typepublic final class MemcachedLock<K,V> extends Object
Constructor and Description |
---|
MemcachedLock(String serverUrl) |
Modifier and Type | Method and Description |
---|---|
SpyMemcached<V> |
client() |
V |
get(K target) |
boolean |
isLocked(K target)
Checks if is locked.
|
boolean |
lock(K target,
long liveTime) |
boolean |
lock(K target,
V value,
long liveTime) |
boolean |
unlock(K target) |
public MemcachedLock(String serverUrl)
public boolean lock(K target, long liveTime)
target
- liveTime
- public boolean lock(K target, V value, long liveTime)
target
- value
- liveTime
- unit is millisecondspublic boolean isLocked(K target)
target
- public boolean unlock(K target)
target
- public SpyMemcached<V> client()
Copyright © 2020. All rights reserved.