public async Task Run([OrchestrationTrigger] IDurableOrchestrationContext context)
        {
            var input = context.GetInput <Input>();

            var circuitBreakerOptions = new CircuitBreakerOptions()
            {
                CircuitBreakerId = input.CircuitBreakerId,
            };

            await context.ExecuteActivityWithCircuitBreaker(ThrottlingActivity.FunctionName, circuitBreakerOptions, null);
        }
示例#2
0
 public static Task ExecuteActivityWithCircuitBreaker(this IDurableOrchestrationContext context, string functionName, CircuitBreakerOptions circuitBreakerOptions, object input)
 {
     return(ExecuteActivityWithCircuitBreaker <object>(context, functionName, circuitBreakerOptions, input));
 }
示例#3
0
        public static Task <T> ExecuteActivityWithCircuitBreaker <T>(this IDurableOrchestrationContext context, string functionName, CircuitBreakerOptions circuitBreakerOptions, object input)
        {
            SubOrchestrator.Input subOrchestratorInput = new SubOrchestrator.Input()
            {
                ActivityFunctionName  = functionName,
                ActivityFunctionInput = input,
                CircuitBreakerOptions = circuitBreakerOptions,
            };

            return(context.CallSubOrchestratorAsync <T>(SubOrchestrator.FunctionName, subOrchestratorInput));
        }