public ISubscriber GetConnection()
        {
            var connection = _connection;

            if (connection == null)
            {
                lock (_connectionLock)
                {
                    if (_connection == null)
                    {
                        _connection = _connectionManager.GetConnection().GetSubscriber();
                    }

                    connection = _connection;
                }
            }

            return(connection);
        }
Example #2
0
        public void Set(string key, RedisValue value, int expirySeconds)
        {
            var conn = _connectionManager.GetConnection();

            conn.GetDatabase(_db).StringSet(key, value, _isRedisExpiryEnabled ? (TimeSpan?)TimeSpan.FromSeconds(expirySeconds) : null);
        }