/// <summary> /// Execute pipeline commands /// </summary> /// <returns>Array of batched command results</returns> public object[] EndPipe() { if (_transaction.Active) { return(_transaction.Execute()); } else { return(_connector.EndPipe()); } }
public object[] Execute() { _active = false; if (_connector.IsConnected && _connector.IsPipelined) { _connector.Call(_execCommand); object[] response = _connector.EndPipe(); for (int i = 1; i < response.Length - 1; i++) { OnTransactionQueued(_pipeCommands[i - 1].Item1, _pipeCommands[i - 1].Item2, response[i - 1].ToString()); } object transaction_response = response[response.Length - 1]; if (!(transaction_response is object[])) { throw new RedisProtocolException("Unexpected response"); } return(transaction_response as object[]); } return(_connector.Call(_execCommand)); }