コード例 #1
0
 public IRedLock CreateLock(string resource, TimeSpan expiryTime)
 {
     return(RedLock.Create(
                redisCaches,
                resource,
                expiryTime));
 }
コード例 #2
0
 public async Task <IRedLock> CreateLockAsync(string resource, TimeSpan expiryTime)
 {
     return(await RedLock.CreateAsync(
                redisCaches,
                resource,
                expiryTime).ConfigureAwait(false));
 }
コード例 #3
0
ファイル: RedLockFactory.cs プロジェクト: xsharkx/RedLock.net
 public IRedLock CreateLock(string resource, TimeSpan expiryTime)
 {
     return(RedLock.Create(
                this.loggerFactory.CreateLogger <RedLock>(),
                redisCaches,
                resource,
                expiryTime));
 }
コード例 #4
0
ファイル: RedLockFactory.cs プロジェクト: CRidge/RedLock.net
 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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #7
0
ファイル: RedLockFactory.cs プロジェクト: CRidge/RedLock.net
 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));
 }
コード例 #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);
        }
コード例 #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);
        }