Skip to content

Commit e79f809

Browse files
sophiatevSophia Tevosyan
andauthored
Add CreateSubOrchestrationInstanceWithRetry overload with tags parameter (#1294)
Co-authored-by: Sophia Tevosyan <stevosyan@microsoft.com>
1 parent b54363c commit e79f809

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/DurableTask.Core/OrchestrationContext.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,25 @@ public virtual Task<T> CreateSubOrchestrationInstanceWithRetry<T>(string name, s
278278
return retryInterceptor.Invoke();
279279
}
280280

281+
/// <summary>
282+
/// Create a sub-orchestration of the specified name and version. Also retry on failure as per supplied policy.
283+
/// </summary>
284+
/// <typeparam name="T">Return Type of the TaskOrchestration.RunTask method</typeparam>
285+
/// <param name="name">Name of the orchestration as specified by the ObjectCreator</param>
286+
/// <param name="version">Name of the orchestration as specified by the ObjectCreator</param>
287+
/// <param name="instanceId">Instance Id of the sub-orchestration</param>
288+
/// <param name="retryOptions">Retry policy</param>
289+
/// <param name="input">Input for the TaskOrchestration.RunTask method</param>
290+
/// <param name="tags">Dictionary of key/value tags associated with this instance</param>
291+
/// <returns>Task that represents the execution of the specified sub-orchestration</returns>
292+
public virtual Task<T> CreateSubOrchestrationInstanceWithRetry<T>(string name, string version, string instanceId,
293+
RetryOptions retryOptions, object input, IDictionary<string, string> tags)
294+
{
295+
Task<T> RetryCall() => CreateSubOrchestrationInstance<T>(name, version, instanceId, input, tags);
296+
var retryInterceptor = new RetryInterceptor<T>(this, retryOptions, RetryCall);
297+
return retryInterceptor.Invoke();
298+
}
299+
281300
/// <summary>
282301
/// Schedule a TaskActivity by type.
283302
/// </summary>

0 commit comments

Comments
 (0)