예제 #1
0
        private InformativeCancellationToken GetCancellationTokenForCommand(BaseCommand command, long? invocationTimeout = null)
        {
            if (IgnoreCancellation())
            {
                return InformativeCancellationToken.ForIgnored();
            }

            var timeout = command.DetermineTimeout(_config, invocationTimeout);
            return InformativeCancellationToken.ForTimeout(timeout);
        }
예제 #2
0
        private InformativeCancellationToken GetCancellationTokenForCommand(CancellationToken ct)
        {
            if (IgnoreCancellation())
            {
                return InformativeCancellationToken.ForIgnored();
            }

            if (!IsEnabled())
            {
                return InformativeCancellationToken.ForDisabled();
            }

            return InformativeCancellationToken.ForOverridingToken(ct);
        }