Пример #1
0
 public ConnectionPool( RedisConfiguration configuration, IConnectionFactory connectionFactory )
 {
     Configuration = configuration;
     ConnectionFactory = connectionFactory;
     AvailableConnections = new ConcurrentQueue<IConnection>();
     ReservedConnections = new ConcurrentDictionary<IConnection, IConnection>();
 }
Пример #2
0
 public LockingConnectionPool( RedisConfiguration configuration, IConnectionFactory connectionFactory )
 {
     AvailableLock = new ReaderWriterLockSlim();
     ReservedLock = new ReaderWriterLockSlim();
     Configuration = configuration;
     ConnectionFactory = connectionFactory;
     AvailableConnections = new Queue<IConnection>();
     ReservedConnections = new HashSet<IConnection>();
     while ( AvailableConnections.Count < Configuration.ConnectionLimit )
     {
         AvailableConnections.Enqueue( ConnectionFactory.GetConnection() );
     }
 }
Пример #3
0
 public Connection( RedisConfiguration configuration )
 {
     Configuration = configuration;
 }
Пример #4
0
 public ConnectionFactory( RedisConfiguration configuration )
 {
     Configuration = configuration;
 }
Пример #5
0
 public RedisConfigurator()
 {
     Configuration = new RedisConfiguration();
 }