Exemple #1
0
 public ConnectionPool( RedisConfiguration configuration, IConnectionFactory connectionFactory )
 {
     Configuration = configuration;
     ConnectionFactory = connectionFactory;
     AvailableConnections = new ConcurrentQueue<IConnection>();
     ReservedConnections = new ConcurrentDictionary<IConnection, IConnection>();
 }
 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() );
     }
 }
Exemple #3
0
 public Connection( RedisConfiguration configuration )
 {
     Configuration = configuration;
 }
 public ConnectionFactory( RedisConfiguration configuration )
 {
     Configuration = configuration;
 }
 public RedisConfigurator()
 {
     Configuration = new RedisConfiguration();
 }