private RedisSubscription(RedisConnectionSettings connectionSettings, Encoding encoding) { _connection = new RedisConnection(connectionSettings); _writer = new RespWriter(_connection.GetStream()); _reader = new RespReader(_connection.GetStream()); _encoding = encoding ?? throw new ArgumentNullException(nameof(encoding)); }
public RedisSubscription(RedisConnectionSettings connectionSettings, Encoding encoding, params string[] channels) : this(connectionSettings, encoding) { if (channels == null) { throw new ArgumentNullException(nameof(channels)); } var channelsBytes = new byte[channels.Length][]; for (var i = 0; i < channels.Length; i++) { channelsBytes[i] = _encoding.GetBytes(channels[i]); } _channels = channelsBytes; }
public RedisSubscription(RedisConnectionSettings connectionSettings, Encoding encoding, IList <byte[]> channels) : this(connectionSettings, encoding) { _channels = channels ?? throw new ArgumentNullException(nameof(channels)); }
public RedisSubscription(RedisConnectionSettings connectionSettings, params string[] channels) : this(connectionSettings, Encoding.UTF8, channels) { }
public RedisConnection(RedisConnectionSettings settings) { // todo: allocate from pool _client = new TcpClient(settings.Hostname, settings.Port); }
public RedisClient(RedisConnectionSettings connectionSettings, Encoding encoding) { _connectionSettings = connectionSettings ?? throw new ArgumentNullException(nameof(connectionSettings)); _encoding = encoding ?? throw new ArgumentNullException(nameof(encoding)); }
public RedisClient(RedisConnectionSettings connectionSettings) : this(connectionSettings, Encoding.UTF8) { }