Esempio n. 1
0
 public IRedLock CreateLock(string resource, TimeSpan expiryTime)
 {
     return(RedLock.Create(
                redisCaches,
                resource,
                expiryTime));
 }
Esempio n. 2
0
 public async Task <IRedLock> CreateLockAsync(string resource, TimeSpan expiryTime)
 {
     return(await RedLock.CreateAsync(
                redisCaches,
                resource,
                expiryTime).ConfigureAwait(false));
 }
Esempio n. 3
0
 public IRedLock CreateLock(string resource, TimeSpan expiryTime)
 {
     return(RedLock.Create(
                this.loggerFactory.CreateLogger <RedLock>(),
                redisCaches,
                resource,
                expiryTime));
 }
Esempio n. 4
0
 public async Task <IRedLock> CreateLockAsync(string resource, TimeSpan expiryTime)
 {
     return(await RedLock.CreateAsync(
                this.loggerFactory.CreateLogger <RedLock>(),
                redisCaches,
                resource,
                expiryTime,
                retryConfiguration : configuration.RetryConfiguration).ConfigureAwait(false));
 }
Esempio n. 5
0
 public async Task <IRedLock> CreateLockAsync(string resource, TimeSpan expiryTime, TimeSpan waitTime, TimeSpan retryTime, CancellationToken?cancellationToken = null)
 {
     return(await RedLock.CreateAsync(
                redisCaches,
                resource,
                expiryTime,
                waitTime,
                retryTime,
                cancellationToken ?? CancellationToken.None).ConfigureAwait(false));
 }
Esempio n. 6
0
 public IRedLock CreateLock(string resource, TimeSpan expiryTime, TimeSpan waitTime, TimeSpan retryTime, CancellationToken?cancellationToken = null)
 {
     return(RedLock.Create(
                redisCaches,
                resource,
                expiryTime,
                waitTime,
                retryTime,
                cancellationToken ?? CancellationToken.None));
 }
Esempio n. 7
0
 public IRedLock CreateLock(string resource, TimeSpan expiryTime, TimeSpan waitTime, TimeSpan retryTime, CancellationToken?cancellationToken = null)
 {
     return(RedLock.Create(
                this.loggerFactory.CreateLogger <RedLock>(),
                redisCaches,
                resource,
                expiryTime,
                waitTime,
                retryTime,
                configuration.RetryConfiguration,
                cancellationToken ?? CancellationToken.None));
 }
Esempio n. 8
0
        internal static RedLock Create(
            ICollection <RedisConnection> redisCaches,
            string resource,
            TimeSpan expiryTime,
            TimeSpan?waitTime  = null,
            TimeSpan?retryTime = null,
            CancellationToken?cancellationToken = null)
        {
            var redisLock = new RedLock(
                redisCaches,
                resource,
                expiryTime,
                waitTime,
                retryTime,
                cancellationToken);

            redisLock.Start();

            return(redisLock);
        }
Esempio n. 9
0
        internal static async Task <RedLock> CreateAsync(
            ICollection <RedisConnection> redisCaches,
            string resource,
            TimeSpan expiryTime,
            TimeSpan?waitTime  = null,
            TimeSpan?retryTime = null,
            CancellationToken?cancellationToken = null)
        {
            var redisLock = new RedLock(
                redisCaches,
                resource,
                expiryTime,
                waitTime,
                retryTime,
                cancellationToken);

            await redisLock.StartAsync().ConfigureAwait(false);

            return(redisLock);
        }