Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/proto
7 changes: 7 additions & 0 deletions src/Abstractions/Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,20 @@
<ItemGroup>
<PackageReference Include="Microsoft.Azure.DurableTask.Core" Version="2.16.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../../src/Grpc/Grpc.csproj" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project should not reference gRPC. It is meant to be implementation agnostic.

</ItemGroup>

<ItemGroup>
<SharedSection Include="Core" />
<SharedSection Include="DependencyInjection" />
<SharedSection Include="Grpc" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 6 additions & 2 deletions src/Abstractions/TaskOptions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

namespace Microsoft.DurableTask;
using P = Microsoft.DurableTask.Protobuf;

namespace Microsoft.DurableTask;
/// <summary>
/// Options that can be used to control the behavior of orchestrator task execution.
/// </summary>
Expand Down Expand Up @@ -100,4 +101,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
/// as well as the options for it.</param>
public record StartOrchestrationOptions(string? InstanceId = null, DateTimeOffset? StartAt = null, Dictionary<P.OrchestrationStatus, P.CreateOrchestrationAction>?
OrchestrationIdReusePolicy = null);
1 change: 1 addition & 0 deletions src/Client/Grpc/GrpcDurableTaskClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to map this from options correct?

};

DateTimeOffset? startAt = options?.StartAt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Copy link
Member

Choose a reason for hiding this comment

The 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>
Expand All @@ -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" />
Copy link
Member

Choose a reason for hiding this comment

The 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>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
using Core = DurableTask.Core;
using CoreOrchestrationQuery = DurableTask.Core.Query.OrchestrationQuery;

using P = Microsoft.DurableTask.Protobuf;

namespace Microsoft.DurableTask.Client.OrchestrationServiceClientShim;

/// <summary>
Expand Down Expand Up @@ -134,6 +136,7 @@ public override async Task<string> ScheduleNewOrchestrationInstanceAsync(
{
cancellation.ThrowIfCancellationRequested();
string instanceId = options?.InstanceId ?? Guid.NewGuid().ToString("N");
Dictionary<P.OrchestrationStatus, P.CreateOrchestrationAction> idReusePolicy = options?.OrchestrationIdReusePolicy ?? new Dictionary<P.OrchestrationStatus, P.CreateOrchestrationAction>();
OrchestrationInstance instance = new()
{
InstanceId = instanceId,
Expand Down