Skip to content

Commit 146da0d

Browse files
YunchuWangCopilot
andcommitted
Align sandbox transport stub typing
Match the existing client.py pattern by modeling generated gRPC stubs with a method-style Protocol and casting the generated stub at the boundary. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f35524d commit 146da0d

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

  • durabletask-azuremanaged/durabletask/azuremanaged/preview/on_demand_sandbox

durabletask-azuremanaged/durabletask/azuremanaged/preview/on_demand_sandbox/transport.py

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

4-
from typing import Callable, Iterable, Optional, Protocol, Sequence, cast
4+
from typing import Iterable, Optional, Protocol, Sequence, cast
55

66
import grpc
77
from azure.core.credentials import TokenCredential
@@ -16,18 +16,20 @@
1616

1717

1818
class _OnDemandSandboxActivitiesStub(Protocol):
19-
DeclareOnDemandSandboxActivities: Callable[
20-
[pb.OnDemandSandboxActivityDeclaration],
21-
pb.OnDemandSandboxActivityDeclarationResult,
22-
]
23-
RemoveOnDemandSandboxActivityDeclaration: Callable[
24-
[pb.RemoveOnDemandSandboxActivityDeclarationRequest],
25-
pb.RemoveOnDemandSandboxActivityDeclarationResult,
26-
]
27-
ConnectOnDemandSandboxActivityWorker: Callable[
28-
[Iterable[pb.OnDemandSandboxActivityWorkerMessage]],
29-
pb.OnDemandSandboxActivityWorkerSessionResult,
30-
]
19+
def DeclareOnDemandSandboxActivities(
20+
self,
21+
request: pb.OnDemandSandboxActivityDeclaration) -> pb.OnDemandSandboxActivityDeclarationResult:
22+
...
23+
24+
def RemoveOnDemandSandboxActivityDeclaration(
25+
self,
26+
request: pb.RemoveOnDemandSandboxActivityDeclarationRequest) -> pb.RemoveOnDemandSandboxActivityDeclarationResult:
27+
...
28+
29+
def ConnectOnDemandSandboxActivityWorker(
30+
self,
31+
request_iterator: Iterable[pb.OnDemandSandboxActivityWorkerMessage]) -> pb.OnDemandSandboxActivityWorkerSessionResult:
32+
...
3133

3234

3335
class OnDemandSandboxActivitiesGrpcTransport:

0 commit comments

Comments
 (0)