C# Class Distributed.Utility.Impl.MemcachedDistributedLock

基于Memcached的分布式锁实现。
Inheritance: IDistributedLock
Exibir arquivo Open project: RabbitTeam/Distributed

Public Methods

Method Description
Lock ( string token ) : void

锁定(超时时间为30秒)。

MemcachedDistributedLock ( IMemcachedClient client ) : System

初始化一个新的基于Memcached的分布式锁。

TryLock ( string token, System.TimeSpan timeout ) : void

尝试锁定。

UnLock ( string token ) : void

解锁。

Private Methods

Method Description
GetTokens ( ) : string[]
Store ( IEnumerable tokens ) : bool

Method Details

Lock() public method

锁定(超时时间为30秒)。
public Lock ( string token ) : void
token string 锁记号。
return void

MemcachedDistributedLock() public method

初始化一个新的基于Memcached的分布式锁。
public MemcachedDistributedLock ( IMemcachedClient client ) : System
client IMemcachedClient Memcached客户端。
return System

TryLock() public method

尝试锁定。
public TryLock ( string token, System.TimeSpan timeout ) : void
token string 锁记号。
timeout System.TimeSpan 超时时间。
return void

UnLock() public method

解锁。
public UnLock ( string token ) : void
token string 锁记号。
return void