Skip to content

Commit cf64aff

Browse files
committed
Interface for supporting azuremanaged
1 parent 78465d5 commit cf64aff

File tree

6 files changed

+33
-14
lines changed

6 files changed

+33
-14
lines changed

samples/LargePayloadConsoleApp/Program.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ await ctx.Entities.CallEntityAsync(
135135
Console.WriteLine($"Deserialized output equals original: {deserializedOutput == largeInput}");
136136
Console.WriteLine($"Deserialized input length: {deserializedInput.Length}");
137137

138-
139-
140138
// Run entity samples
141139
Console.WriteLine();
142140
Console.WriteLine("Running LargeEntityOperationInput...");
@@ -199,7 +197,4 @@ public void Set(string value)
199197
{
200198
this.State = value;
201199
}
202-
}
203-
204-
205-
200+
}

src/Extensions/AzureBlobPayloads/DependencyInjection/DurableTaskClientBuilderExtensions.AzureBlobPayloads.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public static class DurableTaskClientBuilderExtensionsAzureBlobPayloads
2222
/// <param name="builder">The builder to configure.</param>
2323
/// <param name="configure">The callback to configure the storage options.</param>
2424
/// <returns>The original builder, for call chaining.</returns>
25-
/// <returns></returns>
2625
public static IDurableTaskClientBuilder UseExternalizedPayloads(
2726
this IDurableTaskClientBuilder builder,
2827
Action<LargePayloadStorageOptions> configure)

src/Extensions/AzureBlobPayloads/DependencyInjection/DurableTaskWorkerBuilderExtensions.AzureBlobPayloads.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4+
using Grpc.Core.Interceptors;
5+
using Grpc.Net.Client;
46
using Microsoft.DurableTask.Converters;
57
using Microsoft.DurableTask.Worker;
8+
using Microsoft.DurableTask.Worker.Grpc;
69
using Microsoft.Extensions.DependencyInjection;
710
using Microsoft.Extensions.Options;
8-
using Microsoft.DurableTask.Worker.Grpc;
9-
using Grpc.Net.Client;
10-
using Grpc.Core.Interceptors;
1111

1212
namespace Microsoft.DurableTask;
1313

@@ -64,5 +64,3 @@ public static IDurableTaskWorkerBuilder UseExternalizedPayloads(
6464
return builder;
6565
}
6666
}
67-
68-
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
using Grpc.Core;
5+
using Grpc.Core.Interceptors;
6+
using Grpc.Net.Client;
7+
8+
namespace Microsoft.DurableTask;
9+
10+
/// <summary>
11+
/// Static factory for creating large payload interceptors without exposing internal implementation details.
12+
/// </summary>
13+
public static class AzureBlobPayloadCallInvokerFactory
14+
{
15+
/// <summary>
16+
/// Creates a CallInvoker with large payload support interceptor applied to the given GrpcChannel.
17+
/// </summary>
18+
/// <param name="channel">The gRPC channel to intercept.</param>
19+
/// <param name="options">The large payload storage options.</param>
20+
/// <returns>A CallInvoker with the large payload interceptor applied.</returns>
21+
public static CallInvoker Create(GrpcChannel channel, LargePayloadStorageOptions options)
22+
{
23+
IPayloadStore payloadStore = new BlobPayloadStore(options);
24+
// return channel.Intercept(new AzureBlobPayloadsInterceptor(payloadStore, options));
25+
return channel.CreateCallInvoker().Intercept(new AzureBlobPayloadsInterceptor(payloadStore, options));
26+
}
27+
}

src/Extensions/AzureBlobPayloads/Interceptors/AzureBlobPayloadsInterceptor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Microsoft.DurableTask;
1313
/// gRPC interceptor that externalizes large payloads to an <see cref="IPayloadStore"/> on requests
1414
/// and resolves known payload tokens on responses.
1515
/// </summary>
16-
sealed class AzureBlobPayloadsInterceptor(IPayloadStore payloadStore, LargePayloadStorageOptions options) : Interceptor
16+
internal sealed class AzureBlobPayloadsInterceptor(IPayloadStore payloadStore, LargePayloadStorageOptions options) : Interceptor
1717
{
1818
readonly IPayloadStore payloadStore = payloadStore;
1919
readonly LargePayloadStorageOptions options = options;

src/Extensions/AzureBlobPayloads/PayloadStore/BlobPayloadStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Microsoft.DurableTask;
1616
/// Azure Blob Storage implementation of <see cref="IPayloadStore"/>.
1717
/// Stores payloads as blobs and returns opaque tokens in the form "blob:v1:&lt;container&gt;:&lt;blobName&gt;".
1818
/// </summary>
19-
public sealed class BlobPayloadStore : IPayloadStore
19+
internal sealed class BlobPayloadStore : IPayloadStore
2020
{
2121
const string TokenPrefix = "blob:v1:";
2222
const string ContentEncodingGzip = "gzip";

0 commit comments

Comments
 (0)