private void ReadProcedure() { while (!_stopReading) { WaitPair evt = null; lock (_evts) { if (_evts.Any()) { evt = _evts.Dequeue(); } } if (evt != null) { evt.Result = _reader.ReadAny(); evt.ResultIsReady.Set(); } lock (_evts) { if (!_evts.Any() && !_stopReading) { Monitor.Wait(_evts); } } } }
public IEnumerable<byte[]> ExecuteCommand(IRedisCommandBuilder builder) { ExecuteCommandWithoutResult(builder); var reader = new RedisReader(_conn.Reader); if (reader.IsError()) { throw new RedisException(reader.ReadLine()); } return reader.ReadAny(); }
public IEnumerable <byte[]> ExecuteCommand(IRedisCommandBuilder builder) { ExecuteCommandWithoutResult(builder); var reader = new RedisReader(_conn.Reader); if (reader.IsError()) { throw new RedisException(reader.ReadLine()); } return(reader.ReadAny()); }