Esempio n. 1
0
        public Task <ILookupInResult> LookupIn(string id, IEnumerable <OperationSpec> specs, Action <LookupInOptions> configureOptions)
        {
            var options = new LookupInOptions();

            configureOptions(options);

            return(LookupIn(id, specs, options));
        }
Esempio n. 2
0
        public static Task <ILookupInResult> LookupInAsync(this ICollection collection, string id,
                                                           IEnumerable <OperationSpec> specs, Action <LookupInOptions> configureOptions)
        {
            var options = new LookupInOptions();

            configureOptions(options);

            return(collection.LookupInAsync(id, specs, options));
        }
Esempio n. 3
0
        public Task <ILookupInResult> LookupIn(string id, IEnumerable <OperationSpec> specs, TimeSpan?timeout = null,
                                               CancellationToken token = default(CancellationToken))
        {
            var options = new LookupInOptions();

            ConfigureLookupInOptions(options, timeout, token);

            return(LookupIn(id, specs, options));
        }
Esempio n. 4
0
        public Task <ILookupInResult> LookupIn(string id, Action <LookupInSpecBuilder> configureBuilder, Action <LookupInOptions> configureOptions)
        {
            var builder = new LookupInSpecBuilder();

            configureBuilder(builder);

            var options = new LookupInOptions();

            configureOptions(options);

            return(LookupIn(id, builder.Specs, options));
        }
Esempio n. 5
0
        private static void ConfigureLookupInOptions(LookupInOptions options, TimeSpan?timeout, CancellationToken token)
        {
            if (timeout.HasValue)
            {
                options.Timeout(timeout.Value);
            }

            if (token != CancellationToken.None)
            {
                options._Token = token;
            }
        }
Esempio n. 6
0
        public static Task <ILookupInResult> LookupInAsync(this ICollection collection, string id,
                                                           Action <LookupInSpecBuilder> configureBuilder, Action <LookupInOptions> configureOptions)
        {
            var builder = new LookupInSpecBuilder();

            configureBuilder(builder);

            var options = new LookupInOptions();

            configureOptions(options);

            return(collection.LookupInAsync(id, builder.Specs, options));
        }
Esempio n. 7
0
        public Task <ILookupInResult> LookupIn(string id, Action <LookupInSpecBuilder> configureBuilder, TimeSpan?timeout = null,
                                               CancellationToken token = default(CancellationToken))
        {
            var builder = new LookupInSpecBuilder();

            configureBuilder(builder);

            var options = new LookupInOptions();

            ConfigureLookupInOptions(options, timeout, token);

            return(LookupIn(id, builder.Specs, options));
        }
        private async Task <MultiLookup <byte[]> > ExecuteLookupIn(string id, IEnumerable <OperationSpec> specs, LookupInOptions options)
        {
            // convert new style specs into old style builder
            var builder = new LookupInBuilder <byte[]>(null, null, id, specs);

            var lookup = new MultiLookup <byte[]>
            {
                Key     = id,
                Builder = builder,
                Cid     = Cid
            };

            await ExecuteOp(lookup, options.Token, options.Timeout);

            return(lookup);
        }
 public async Task <ILookupInResult> LookupInAsync(string id, IEnumerable <OperationSpec> specs, LookupInOptions options)
 {
     using (var lookup = await ExecuteLookupIn(id, specs, options))
     {
         return(new LookupInResult(lookup.ExtractData(), lookup.Cas, null));
     }
 }
Esempio n. 10
0
        public static Task <ILookupInResult> LookupInAsync(this ICollection collection, string id,
                                                           Action <LookupInSpecBuilder> configureBuilder, LookupInOptions options)
        {
            var lookupInSpec = new LookupInSpecBuilder();

            configureBuilder(lookupInSpec);

            return(collection.LookupInAsync(id, lookupInSpec.Specs, options));
        }
Esempio n. 11
0
        public Task <ILookupInResult> LookupIn(string id, Action <LookupInSpecBuilder> configureBuilder, LookupInOptions options)
        {
            var lookupInSpec = new LookupInSpecBuilder();

            configureBuilder(lookupInSpec);

            return(LookupIn(id, lookupInSpec.Specs, options));
        }
Esempio n. 12
0
        public async Task <ILookupInResult> LookupIn(string id, IEnumerable <OperationSpec> specs, LookupInOptions options)
        {
            var lookup = await ExecuteLookupIn(id, specs, options);

            return(new LookupInResult(lookup.Data.ToArray(), lookup.Cas, null));
        }