예제 #1
0
        internal ConnectionSelector(Int32 count, Func <TConnection> factory, RedisClientOptions options)
        {
            _connections = Enumerable
                           .Range(0, count)
                           .Select(i => factory())
                           .ToArray();

            _selector = options.LoadBasedSelector;
            _options  = options;
        }
        internal AggregatedCommandConnection(Int32 count, Func <TConnection> factory, RedisClientOptions options)
        {
            Contract.Assert(options != null, "Redis optiosn cannot be null.");

            _commanders = Enumerable
                          .Range(0, count)
                          .Select(i => factory())
                          .ToArray();

            _selector = options.LoadBasedSelector;
            _options  = options;
        }
예제 #3
0
        /// <summary>
        /// Initializes an instance of <see cref="RedisClientOptions"/> with the default configuration.
        /// </summary>
        public RedisClientOptions()
        {
            PingTimeout             = Timeout.InfiniteTimeSpan;
            ConnectionTimeout       = TimeSpan.FromSeconds(5);
            ReadBufferSize          = 8192;
            WriteBufferSize         = 8192;
            UseExecutionPlanCaching = true;
            LoadBasedSelector       = new BasicLoadBasedSelector();
            PreventPingIfActive     = true;
            Logger = NoLogger.Instance;
            var multiplexPool = new MultiplexPoolOptions();

            multiplexPool.CommandConnections  = 2;
            multiplexPool.SubscriptionOptions = 2;
            MultiplexPool = multiplexPool;
            var exclusivePool = new ExclusivePoolOptions();

            exclusivePool.Minimum = 0;
            exclusivePool.Maximum = 0;
            ExclusivePool         = exclusivePool;
        }