示例#1
0
        //
        // Flow
        //

        /// <summary>
        /// Helps reuse all the SetupFlow code for both methods: WithBackoff, and OnlyOnFailuresWithBackoff
        /// </summary>
        private static Flow <TIn, TOut, NotUsed> RestartFlowFactory <TIn, TOut, TMat>(Func <Flow <TIn, TOut, TMat> > flowFactory, bool onlyOnFailures, RestartSettings settings)
        {
            // choose the correct backoff method
            return(onlyOnFailures
                ? RestartFlow.OnFailuresWithBackoff(flowFactory, settings)
                : RestartFlow.WithBackoff(flowFactory, settings));
        }
示例#2
0
        //
        // Flow
        //

        /// <summary>
        /// Helps reuse all the SetupFlow code for both methods: WithBackoff, and OnlyOnFailuresWithBackoff
        /// </summary>
        private static Flow <TIn, TOut, NotUsed> RestartFlowFactory <TIn, TOut, TMat>(Func <Flow <TIn, TOut, TMat> > flowFactory, TimeSpan minBackoff, TimeSpan maxBackoff, double randomFactor, int maxRestarts, bool onlyOnFailures)
        {
            // choose the correct backoff method
            return(onlyOnFailures
                ? RestartFlow.OnFailuresWithBackoff(flowFactory, minBackoff, maxBackoff, randomFactor, maxRestarts)
                : RestartFlow.WithBackoff(flowFactory, minBackoff, maxBackoff, randomFactor, maxRestarts));
        }