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

Inheritance: IDistributedLock
Afficher le fichier Open project: ServiceStack/ServiceStack.Redis Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
CalculateLockExpire ( System.TimeSpan ts, int timeout ) : long

Method Details

Lock() public méthode

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
Résultat long

Unlock() public méthode

unlock key
public Unlock ( string key, long lockExpire, IRedisClient client ) : bool
key string
lockExpire long
client IRedisClient
Résultat bool