Skip to content

Commit

Permalink
Switch to Microsoft.DurableTask.Grpc (#2605)
Browse files Browse the repository at this point in the history
  • Loading branch information
jviau authored Sep 27, 2023
1 parent 06d0713 commit 5429a27
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ async Task<CleanEntityStorageResult> IDurableEntityClient.CleanEntityStorageAsyn
}
else
{
return await CleanEntityStorageLegacyAsync(removeEmptyEntities, releaseOrphanedLocks, cancellationToken);
return await this.CleanEntityStorageLegacyAsync(removeEmptyEntities, releaseOrphanedLocks, cancellationToken);
}
}

Expand Down
13 changes: 6 additions & 7 deletions src/WebJobs.Extensions.DurableTask/LocalGrpcListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using DurableTask.Core;
Expand Down Expand Up @@ -208,7 +207,7 @@ await this.GetDurabilityProvider(context).SendTaskOrchestrationMessageAsync(
request.Input,
EntityMessageEvent.GetCappedScheduledTime(
DateTime.UtcNow,
entityOrchestrationService.EntityBackendProperties.MaximumSignalDelayTime,
entityOrchestrationService.EntityBackendProperties!.MaximumSignalDelayTime,
request.ScheduledTime?.ToDateTime()));

await durabilityProvider.SendTaskOrchestrationMessageAsync(eventToSend.AsTaskMessage());
Expand All @@ -221,7 +220,7 @@ await this.GetDurabilityProvider(context).SendTaskOrchestrationMessageAsync(
{
this.CheckEntitySupport(context, out var durabilityProvider, out var entityOrchestrationService);

EntityBackendQueries.EntityMetadata? metaData = await entityOrchestrationService.EntityBackendQueries.GetEntityAsync(
EntityBackendQueries.EntityMetadata? metaData = await entityOrchestrationService.EntityBackendQueries!.GetEntityAsync(
DTCore.Entities.EntityId.FromString(request.InstanceId),
request.IncludeState,
includeDeleted: false,
Expand All @@ -239,7 +238,7 @@ await this.GetDurabilityProvider(context).SendTaskOrchestrationMessageAsync(
this.CheckEntitySupport(context, out var durabilityProvider, out var entityOrchestrationService);

P.EntityQuery query = request.Query;
EntityBackendQueries.EntityQueryResult result = await entityOrchestrationService.EntityBackendQueries.QueryEntitiesAsync(
EntityBackendQueries.EntityQueryResult result = await entityOrchestrationService.EntityBackendQueries!.QueryEntitiesAsync(
new EntityBackendQueries.EntityQuery()
{
InstanceIdStartsWith = query.InstanceIdStartsWith,
Expand Down Expand Up @@ -269,7 +268,7 @@ await this.GetDurabilityProvider(context).SendTaskOrchestrationMessageAsync(
{
this.CheckEntitySupport(context, out var durabilityProvider, out var entityOrchestrationService);

EntityBackendQueries.CleanEntityStorageResult result = await entityOrchestrationService.EntityBackendQueries.CleanEntityStorageAsync(
EntityBackendQueries.CleanEntityStorageResult result = await entityOrchestrationService.EntityBackendQueries!.CleanEntityStorageAsync(
new EntityBackendQueries.CleanEntityStorageRequest()
{
RemoveEmptyEntities = request.RemoveEmptyEntities,
Expand Down Expand Up @@ -447,10 +446,10 @@ private OrchestrationStatus[] GetStatusesNotToOverride()
private void CheckEntitySupport(ServerCallContext context, out DurabilityProvider durabilityProvider, out IEntityOrchestrationService entityOrchestrationService)
{
durabilityProvider = this.GetDurabilityProvider(context);
entityOrchestrationService = durabilityProvider as IEntityOrchestrationService;
entityOrchestrationService = durabilityProvider;
if (entityOrchestrationService?.EntityBackendProperties == null)
{
throw new NotSupportedException($"The provider '{durabilityProvider.GetType().Name}' does not support entities.");
throw new NotSupportedException($"The provider '{durabilityProvider.GetBackendInfo()}' does not support entities.");
}
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<!-- Explicitly pinned transitive dependencies with CVE vulnerabilities.-->
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets" Version="2.2.1" />
<!-- The gRPC dependencies in this package are not compatible with older frameworks, like .NET Core 2.x -->
<PackageReference Include="Microsoft.DurableTask.Sidecar.Protobuf" Version="1.0.0" />
<PackageReference Include="Microsoft.DurableTask.Grpc" Version="1.1.0-entities-preview.1" />
</ItemGroup>

<!-- Common dependencies across all targets -->
Expand Down

0 comments on commit 5429a27

Please sign in to comment.