-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial push for adding orchestration reuse ID #258
base: main
Are you sure you want to change the base?
Changes from all commits
e3c1304
47c5446
d44e411
4fa6141
4e7de08
81b993a
5a79b5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Microsoft.DurableTask; | ||
|
||
/// <summary> | ||
/// Enum describing the runtime status of the orchestration. | ||
/// </summary> | ||
public enum OrchestrationRuntimeStatus | ||
{ | ||
/// <summary> | ||
/// The orchestration started running. | ||
/// </summary> | ||
Running, | ||
|
||
/// <summary> | ||
/// The orchestration completed normally. | ||
/// </summary> | ||
Completed, | ||
|
||
/// <summary> | ||
/// The orchestration is transitioning into a new instance. | ||
/// </summary> | ||
[Obsolete("The ContinuedAsNew status is obsolete and exists only for compatibility reasons.")] | ||
ContinuedAsNew, | ||
|
||
/// <summary> | ||
/// The orchestration completed with an unhandled exception. | ||
/// </summary> | ||
Failed, | ||
|
||
/// <summary> | ||
/// The orchestration canceled gracefully. | ||
/// </summary> | ||
[Obsolete("The Canceled status is not currently used and exists only for compatibility reasons.")] | ||
Canceled, | ||
|
||
/// <summary> | ||
/// The orchestration was abruptly terminated via a management API call. | ||
/// </summary> | ||
Terminated, | ||
|
||
/// <summary> | ||
/// The orchestration was scheduled but hasn't started running. | ||
/// </summary> | ||
Pending, | ||
|
||
/// <summary> | ||
/// The orchestration has been suspended. | ||
/// </summary> | ||
Suspended, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,7 @@ public SubOrchestrationOptions(TaskOptions options, string? instanceId = null) | |
/// The time when the orchestration instance should start executing. If not specified or if a date-time in the past | ||
/// is specified, the orchestration instance will be scheduled immediately. | ||
/// </param> | ||
public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null); | ||
/// <param name="OrchestrationIdReusePolicy">The orchestration reuse policy. This allows for the reuse of an instance ID | ||
/// if the instance ID referenced is in any of the states supplied in this parameter.</param> | ||
public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null, | ||
OrchestrationRuntimeStatus[]? OrchestrationIdReusePolicy = null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we wrap this in a type: OrchestrationIdReuse.IfTerminal; // has all terminal statuses included.
OrchestrationIdReuse.Always; // has all statuses included.
OrchestrationIdReuse.IfStatus(params OrchestrationRuntimeStatus[] statuses);
OrchestrationIdReuse.IfStatus(IEnumerable<OrchestrationRuntimeStatus> statuses);
OrchestrationIdReuse.Never; // equal to default. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,7 @@ public override async Task<string> ScheduleNewOrchestrationInstanceAsync( | |
Version = orchestratorName.Version, | ||
InstanceId = options?.InstanceId ?? Guid.NewGuid().ToString("N"), | ||
Input = this.DataConverter.Serialize(input), | ||
OrchestrationIdReusePolicy = { }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need to map this from |
||
}; | ||
|
||
DateTimeOffset? startAt = options?.StartAt; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,11 @@ The client is responsible for interacting with orchestrations from outside the w | |
<EnableStyleCop>true</EnableStyleCop> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are these packages needed for? |
||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<!-- We are still working on this package for entities preview. --> | ||
<VersionPrefix>1.0.5</VersionPrefix> | ||
|
@@ -17,11 +22,13 @@ The client is responsible for interacting with orchestrations from outside the w | |
|
||
<ItemGroup> | ||
<ProjectReference Include="../Core/Client.csproj" /> | ||
<ProjectReference Include="../../Grpc/Grpc.csproj" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this shouldn't be depending on gRPC |
||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<SharedSection Include="Core" /> | ||
<SharedSection Include="DependencyInjection" /> | ||
<SharedSection Include="Grpc" /> | ||
</ItemGroup> | ||
|
||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will need to have type-forwarding from this type in the client package.