Inheritance: RedisMessage, IMultiMessage
示例#1
0
 /// <summary>
 /// Sends all currently buffered commands to the redis server in a single unit; the transaction may subsequently be re-used to buffer additional blocks of commands if needed.
 /// </summary>
 public Task Execute(bool queueJump = false)
 {
     var all = DequeueAll();
     if (all.Length == 0)
     {
         TaskCompletionSource<bool> nix = new TaskCompletionSource<bool>();
         nix.SetResult(true);
         return nix.Task;
     }
     var multiMessage = new MultiMessage(parent, all);
     parent.EnqueueMessage(multiMessage, queueJump);
     return multiMessage.Completion;
 }
示例#2
0
        /// <summary>
        /// Sends all currently buffered commands to the redis server in a single unit; the transaction may subsequently be re-used to buffer additional blocks of commands if needed.
        /// </summary>
        public Task <bool> Execute(bool queueJump = false, object state = null)
        {
            var all = DequeueAll();

            if (all.Length == 0)
            {
                return(AlwaysTrue);
            }

            var multiMessage = new MultiMessage(Parent, all, conditions, state);

            conditions = null; // wipe
            Parent.EnqueueMessage(multiMessage, queueJump);
            return(multiMessage.Completion);
        }
示例#3
0
        /// <summary>
        ///     Sends all currently buffered commands to the redis server in a single unit; the transaction may subsequently be re-used to buffer additional blocks of commands if needed.
        /// </summary>
        public Task <bool> Execute(bool queueJump = false, object state = null)
        {
            RedisMessage[] all = DequeueAll();
            if (all.Length == 0)
            {
                var nix = new TaskCompletionSource <bool>();
                nix.SetResult(true);
                return(nix.Task);
            }
            var multiMessage = new MultiMessage(parent, all, conditions, state);

            conditions = null; // wipe
            parent.EnqueueMessage(multiMessage, queueJump);
            return(multiMessage.Completion);
        }
 /// <summary>
 ///     Sends all currently buffered commands to the redis server in a single unit; the transaction may subsequently be re-used to buffer additional blocks of commands if needed.
 /// </summary>
 public Task<bool> Execute(bool queueJump = false, object state = null)
 {
     RedisMessage[] all = DequeueAll();
     if (all.Length == 0)
     {
         var nix = new TaskCompletionSource<bool>();
         nix.SetResult(true);
         return nix.Task;
     }
     var multiMessage = new MultiMessage(parent, all, conditions, state);
     conditions = null; // wipe
     parent.EnqueueMessage(multiMessage, queueJump);
     return multiMessage.Completion;
 }