Provides information about the delayed retries configuration.
コード例 #1
0
        static bool TryGetDelay(IncomingMessage message, int delayedDeliveriesPerformed, DelayedConfig config, out TimeSpan delay)
        {
            delay = TimeSpan.MinValue;

            if (config.MaxNumberOfRetries == 0)
            {
                return false;
            }

            if (delayedDeliveriesPerformed >= config.MaxNumberOfRetries)
            {
                return false;
            }

            if (HasReachedMaxTime(message))
            {
                return false;
            }

            delay = TimeSpan.FromTicks(config.TimeIncrease.Ticks*(delayedDeliveriesPerformed + 1));

            return true;
        }
コード例 #2
0
        static bool TryGetDelay(IncomingMessage message, int delayedDeliveriesPerformed, DelayedConfig config, out TimeSpan delay)
        {
            delay = TimeSpan.MinValue;

            if (config.MaxNumberOfRetries == 0)
            {
                return(false);
            }

            if (delayedDeliveriesPerformed >= config.MaxNumberOfRetries)
            {
                return(false);
            }

            if (HasReachedMaxTime(message))
            {
                return(false);
            }

            delay = TimeSpan.FromTicks(config.TimeIncrease.Ticks * (delayedDeliveriesPerformed + 1));

            return(true);
        }