Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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;
            }
        }