C# Class ServiceStack.Redis.Support.Locking.DistributedLock

Inheritance: IDistributedLock
Exibir arquivo Open project: ServiceStack/ServiceStack.Redis Class Usage Examples

Public Methods

Method Description
Lock ( string key, int acquisitionTimeout, int lockTimeout, long &lockExpire, IRedisClient client ) : long

acquire distributed, non-reentrant lock on key

Unlock ( string key, long lockExpire, IRedisClient client ) : bool

unlock key

Private Methods

Method Description
CalculateLockExpire ( System.TimeSpan ts, int timeout ) : long

Method Details

Lock() public method

acquire distributed, non-reentrant lock on key
public Lock ( string key, int acquisitionTimeout, int lockTimeout, long &lockExpire, IRedisClient client ) : long
key string global key for this lock
acquisitionTimeout int timeout for acquiring lock
lockTimeout int timeout for lock, in seconds (stored as value against lock key)
lockExpire long
client IRedisClient
return long

Unlock() public method

unlock key
public Unlock ( string key, long lockExpire, IRedisClient client ) : bool
key string
lockExpire long
client IRedisClient
return bool