Ejemplo n.º 1
0
        public async Task <ISubscriber> GetSubscriberAsync(string redisConnectionString)
        {
            if (string.IsNullOrWhiteSpace(redisConnectionString))
            {
                throw new ArgumentNullException(redisConnectionString);
            }
            var connect = await DefaultRedisPersistentConnection.GetConnectAsync(redisConnectionString);

            if (!connect.IsConnected())
            {
                connect = await DefaultRedisPersistentConnection.TryConnectAsync(redisConnectionString);
            }
            return(connect.GetSubscriber());
        }
Ejemplo n.º 2
0
        public async Task <IDatabase> GetDatabaseAsync(string redisConnectionString = null, int db = 0, object asyncState = null)
        {
            if (string.IsNullOrWhiteSpace(redisConnectionString))
            {
                throw new ArgumentNullException(redisConnectionString);
            }
            var connect = await DefaultRedisPersistentConnection.GetConnectAsync(redisConnectionString);

            if (!connect.IsConnected())
            {
                connect = await DefaultRedisPersistentConnection.TryConnectAsync(redisConnectionString);
            }
            return(connect.GetDatabase(db, asyncState));
        }