public async Task <T> CallAsync <T>(RedisCommand <T> command) { //if (_autoPipeline.IsEnabled) // return _autoPipeline.EnqueueAsync(command); //await _io.Writer.WriteAsync(command, _io.Stream); await _io.WriteAsync(command); //_io.Stream.BeginRead() return(command.Parse(_io.Reader)); }
async public Task <T> CallAsync <T>(RedisCommand <T> command) { var operationId = Guid.Empty; var key = command.Arguments.Length > 0 ? command.Arguments[0].ToString() : ""; try { operationId = _diagnosticListener.WriteCallBefore(new CallEventData(command.Command, key)); await _io.WriteAsync(command); var res = command.Parse(_io.Reader); _diagnosticListener.WriteCallAfter(operationId, new CallEventData(command.Command, key)); return(res); } catch (Exception ex) { _diagnosticListener.WriteCallError(operationId, new CallEventData(command.Command, key), ex); throw; } }