public async Task <ReturnType> InvokeWithRetry <ReturnType>(string methodName, object[] args) { Func <Task <ReturnType> > retryCall = () => { return(Impromptu.InvokeMember(wrappedObject, methodName, args)); }; var retryInterceptor = new RetryInterceptor <ReturnType>(context, retryOptions, retryCall); return(await retryInterceptor.Invoke()); }
/// <summary> /// Create a sub-orchestration of the specified name and version. Also retry on failure as per supplied policy. /// </summary> /// <typeparam name="T">Return Type of the TaskOrchestration.RunTask method</typeparam> /// <param name="name">Name of the orchestration as specified by the ObjectCreator</param> /// <param name="version">Name of the orchestration as specified by the ObjectCreator</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 sub-orchestration</returns> public virtual Task <T> CreateSubOrchestrationInstanceWithRetry <T>(string name, string version, RetryOptions retryOptions, object input) { Func <Task <T> > retryCall = () => this.CreateSubOrchestrationInstance <T>(name, version, input); var retryInterceptor = new RetryInterceptor <T>(this, retryOptions, retryCall); return(retryInterceptor.Invoke()); }
/// <summary> /// Schedule a TaskActivity by name and version. Also retry on failure as per supplied policy. /// </summary> /// <typeparam name="T">Return Type of the TaskActivity.Exeute method</typeparam> /// <param name="name">Name of the orchestration as specified by the ObjectCreator</param> /// <param name="version">Name of the orchestration as specified by the ObjectCreator</param> /// <param name="retryOptions">Retry policy</param> /// <param name="parameters">Parameters for the TaskActivity.Execute method</param> /// <returns>Task that represents the execution of the specified TaskActivity</returns> public virtual Task <T> ScheduleWithRetry <T>(string name, string version, RetryOptions retryOptions, params object[] parameters) { Func <Task <T> > retryCall = () => this.ScheduleTask <T>(name, version, parameters); var retryInterceptor = new RetryInterceptor <T>(this, retryOptions, retryCall); return(retryInterceptor.Invoke()); }
private async Task <TReturnType> InvokeWithRetry <TReturnType>(IInvocation invocation) { Task <TReturnType> RetryCall() { invocation.Proceed(); return((Task <TReturnType>)invocation.ReturnValue); } var retryInterceptor = new RetryInterceptor <TReturnType>(this.context, this.retryOptions, RetryCall); return(await retryInterceptor.Invoke()); }
public async Task <ReturnType> InvokeWithRetry <ReturnType>(string methodName, object[] args) { Func <Task <ReturnType> > retryCall = () => { #if NETSTANDARD2_0 return(Dynamitey.Dynamic.InvokeMember(wrappedObject, methodName, args)); #else return(ImpromptuInterface.Impromptu.InvokeMember(wrappedObject, methodName, args)); #endif }; var retryInterceptor = new RetryInterceptor <ReturnType>(context, retryOptions, retryCall); return(await retryInterceptor.Invoke()); }
public async Task <TReturnType> InvokeWithRetry <TReturnType>(string methodName, object[] args) { Task <TReturnType> RetryCall() { #if NETSTANDARD2_0 return(Dynamitey.Dynamic.InvokeMember(this.wrappedObject, methodName, args)); #else return(ImpromptuInterface.Impromptu.InvokeMember(this.wrappedObject, methodName, args)); #endif } var retryInterceptor = new RetryInterceptor <TReturnType>(this.context, this.retryOptions, RetryCall); return(await retryInterceptor.Invoke()); }