Exemple #1
0
        public Task Touch(string id, TimeSpan expiration, Action <TouchOptions> configureOptions)
        {
            var options = new TouchOptions();

            configureOptions(options);

            return(Touch(id, expiration, options));
        }
Exemple #2
0
        public Task Touch(string id, TimeSpan expiration, Action <TouchOptions> optionsAction)
        {
            var options = new TouchOptions();

            optionsAction(options);

            return(Touch(id, expiration, options));
        }
Exemple #3
0
        public static Task TouchAsync(this ICollection collection, string id, TimeSpan expiration,
                                      Action <TouchOptions> configureOptions)
        {
            var options = new TouchOptions();

            configureOptions(options);

            return(collection.TouchAsync(id, expiration, options));
        }
Exemple #4
0
        public Task Touch(string id, TimeSpan expiration, TimeSpan?timeout = null,
                          DurabilityLevel durabilityLevel = DurabilityLevel.None, CancellationToken token = default(CancellationToken))
        {
            var options = new TouchOptions
            {
                Timeout         = timeout,
                DurabilityLevel = durabilityLevel,
                Token           = token
            };

            return(Touch(id, expiration, options));
        }
Exemple #5
0
        public async Task Touch(string id, TimeSpan expiration, TouchOptions options)
        {
            var touchOp = new Touch
            {
                Key               = id,
                Cid               = Cid,
                Expires           = expiration.ToTtl(),
                DurabilityLevel   = options.DurabilityLevel,
                DurabilityTimeout = TimeSpan.FromMilliseconds(1500)
            };

            await ExecuteOp(touchOp, options.Token, options.Timeout).ConfigureAwait(false);
        }