Exemplo n.º 1
0
        public AdHocTimeoutsProvider(TailTimeoutBehaviour tailBehaviour, [NotNull] params Func <TimeSpan>[] providers)
        {
            if (providers == null)
            {
                throw new ArgumentNullException(nameof(providers));
            }

            if (providers.Length == 0)
            {
                throw new ArgumentException("At least one timeout provider delegate must be specified.", nameof(providers));
            }

            this.providers     = providers;
            this.tailBehaviour = tailBehaviour;
        }
        /// <param name="tailBehaviour">A behaviour in case when provided timeout values are exhausted.</param>
        /// <param name="timeouts">A timeouts which this provider should return.</param>
        /// <exception cref="ArgumentNullException"><paramref name="timeouts"/> is null.</exception>
        /// <exception cref="ArgumentException"><paramref name="timeouts"/> is empty.</exception>
        public FixedTimeoutsProvider(TailTimeoutBehaviour tailBehaviour, [NotNull] params TimeSpan[] timeouts)
        {
            if (timeouts == null)
            {
                throw new ArgumentNullException(nameof(timeouts));
            }

            if (timeouts.Length == 0)
            {
                throw new ArgumentException("At least one timeout must be specified.", nameof(timeouts));
            }

            this.timeouts      = timeouts;
            this.tailBehaviour = tailBehaviour;
        }