/// <summary>
        /// Issue exec command (not queued)
        /// </summary>
        private async ValueTask ExecAsync(CancellationToken token)
        {
            RedisClient.Exec();
            await RedisClient.FlushSendBufferAsync(token).ConfigureAwait(false);

            RedisClient.ResetSendBuffer();
        }
예제 #2
0
        public void Commit()
        {
            try
            {
                var resultCount = redisClient.Exec();
                if (resultCount != queuedCommands.Count)
                {
                    throw new InvalidOperationException(string.Format(
                                                            "Invalid results received from 'EXEC', expected '{0}' received '{1}'"
                                                            + "\nWarning: Transaction was committed",
                                                            queuedCommands.Count, resultCount));
                }

                foreach (var queuedCommand in queuedCommands)
                {
                    queuedCommand.ProcessResult();
                }
            }
            finally
            {
                redisClient.CurrentTransaction = null;
                redisClient.AddTypeIdsRegisteredDuringTransaction();
            }
        }
예제 #3
0
 /// <summary>
 /// Issue exec command (not queued)
 /// </summary>
 private void Exec()
 {
     RedisClient.Exec();
     RedisClient.FlushSendBuffer();
 }