Example #1
0
        public MIGRATE(
            IPEndPoint ipEndPoint,
            IReadOnlyList <Key> keys,
            DatabaseNumber destinationDb,
            MillisecondsTimeout timeout,
            SourceKeyBehavior sourceKeyBehavior,
            DestinationKeyBehavior destinationKeyBehavior,
            Auth auth)
        {
            if (sourceKeyBehavior != SourceKeyBehavior.Move && sourceKeyBehavior != SourceKeyBehavior.Copy)
            {
                throw new ArgumentException(
                          $"Must be either Move or Copy, but {sourceKeyBehavior} found",
                          nameof(sourceKeyBehavior)
                          );
            }

            if (destinationKeyBehavior != DestinationKeyBehavior.Replace &&
                destinationKeyBehavior != DestinationKeyBehavior.EnsureKeyExists)
            {
                throw new ArgumentException(
                          $"Must be either Replace or EnsureKeyExists, but {destinationKeyBehavior} found",
                          nameof(destinationKeyBehavior)
                          );
            }

            this.ipEndPoint             = ipEndPoint;
            this.keys                   = keys;
            this.destinationDb          = destinationDb;
            this.timeout                = timeout;
            this.sourceKeyBehavior      = sourceKeyBehavior;
            this.destinationKeyBehavior = destinationKeyBehavior;
            this.auth                   = auth;
        }
Example #2
0
 public BLOCK(
     GroupName groupName,
     ConsumerName consumerName,
     Count count,
     MillisecondsTimeout blockTimeout,
     Mode mode,
     params Key[] streams)
     : this(groupName, consumerName, count, blockTimeout, mode, streams as IReadOnlyList <Key>)
 {
 }
Example #3
0
        public WAIT(long numReplicas, MillisecondsTimeout timeout)
        {
            if (numReplicas <= 0)
            {
                var message = numReplicas == 0
                    ? "Zero replicas is meaningless"
                    : "Number of replicas must be positive";
                throw new ArgumentOutOfRangeException(nameof(numReplicas), numReplicas, message);
            }

            this.numReplicas = numReplicas;
            this.timeout     = timeout;
        }
Example #4
0
 public MIGRATE(
     IPEndPoint ipEndPoint,
     IReadOnlyList <Key> keys,
     DatabaseNumber destinationDb,
     MillisecondsTimeout timeout)
     : this(
         ipEndPoint,
         keys,
         destinationDb,
         timeout,
         SourceKeyBehavior.Move,
         DestinationKeyBehavior.EnsureKeyExists,
         NoAuth.Singleton
         )
 {
 }
Example #5
0
 public BLOCK(
     GroupName groupName,
     ConsumerName consumerName,
     Count count,
     MillisecondsTimeout blockTimeout,
     Mode mode,
     IReadOnlyList <Key> streams)
 {
     ValidateMode(mode);
     this.groupName    = groupName;
     this.consumerName = consumerName;
     this.count        = count ?? throw new ArgumentNullException(nameof(count));
     this.blockTimeout = blockTimeout;
     this.streams      = streams ?? throw new ArgumentNullException(nameof(streams));
     this.mode         = mode;
 }
Example #6
0
 public PAUSE(MillisecondsTimeout timeout)
 {
     this.timeout = timeout;
 }
Example #7
0
 public BLOCK(Count count, MillisecondsTimeout blockTimeout, params (Key Key, Offset Offset)[] streams)