|
|
|
@ -7,11 +7,11 @@ namespace Expedience.Infrastructure.Concurrency
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public interface IDistributedLock
|
|
|
|
public interface IDistributedLock
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool AcquireLock(string lockKey, TimeSpan timeout);
|
|
|
|
bool AcquireLock(string lockKey, TimeSpan timeout, TimeSpan lockExpiration);
|
|
|
|
void ReleaseLock(string lockKey);
|
|
|
|
void ReleaseLock(string lockKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class DistributedLock
|
|
|
|
public class DistributedLock : IDistributedLock
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private readonly IMemcachedClient _memcachedClient;
|
|
|
|
private readonly IMemcachedClient _memcachedClient;
|
|
|
|
|
|
|
|
|
|
|
|
|