public RetryProxy(OrchestrationContext context, RetryOptions retryOptions, T wrappedObject) { this.context = context; this.retryOptions = retryOptions; this.wrappedObject = wrappedObject; //If type can be determined by name returnTypes = typeof(T).GetMethods() .Where(method => !method.IsSpecialName) .GroupBy(method => method.Name) .Where(group => group.Select(method => method.ReturnType).Distinct().Count() == 1) .Select(group => new { Name = group.Key, ReturnType = group.Select(method => method.ReturnType).Distinct().Single() }) .ToDictionary(info => info.Name, info => info.ReturnType); }
public RetryInterceptor(OrchestrationContext context, RetryOptions retryOptions, Func <Task <T> > retryCall) { this.context = context; this.retryOptions = retryOptions; this.retryCall = retryCall; }
/// <summary> /// Create a suborchestration of the specified type. Also retry on failure as per supplied policy. /// </summary> /// <typeparam name="T">Return Type of the TaskOrchestration.RunTask method</typeparam> /// <param name="orchestrationType">Type of the TaskOrchestration derived class to instantiate</param> /// <param name="instanceId">Instance Id of the suborchestration</param> /// <param name="retryOptions">Retry policy</param> /// <param name="input">Input for the TaskOrchestration.RunTask method</param> /// <returns>Task that represents the execution of the specified suborchestration</returns> public virtual Task <T> CreateSubOrchestrationInstanceWithRetry <T>(Type orchestrationType, string instanceId, RetryOptions retryOptions, object input) { return(CreateSubOrchestrationInstanceWithRetry <T>(NameVersionHelper.GetDefaultName(orchestrationType), NameVersionHelper.GetDefaultVersion(orchestrationType), instanceId, retryOptions, input)); }