Skip to content

Commit 22e55b1

Browse files
committed
Make interface explicit in imports
1 parent a603eea commit 22e55b1

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

hello_nexus/caller/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from temporalio.client import Client
66
from temporalio.worker import UnsandboxedWorkflowRunner, Worker
77

8-
from hello_nexus.caller.workflows import (
8+
from hello_nexus.caller.workflows_via_interface import (
99
Echo2CallerWorkflow,
1010
Echo3CallerWorkflow,
1111
EchoCallerWorkflow,
@@ -17,7 +17,9 @@
1717

1818

1919
async def execute_workflow(workflow_cls: Type[Any], input: Any) -> None:
20-
client = await Client.connect("localhost:7233", namespace="my-caller-namespace-python")
20+
client = await Client.connect(
21+
"localhost:7233", namespace="my-caller-namespace-python"
22+
)
2123
task_queue = "my-caller-task-queue"
2224

2325
async with Worker(
File renamed without changes.

hello_nexus/service/interface.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ class EchoOutput:
2323
message: str
2424

2525

26-
@nexusrpc.service
26+
# TODO(dan): for now, making interface explicit in imports to distinguish from handler
27+
# implementation. Final import scheme and names TBD.
28+
@nexusrpc.interface.service
2729
class MyNexusService:
28-
echo: nexusrpc.Operation[EchoInput, EchoOutput]
29-
hello: nexusrpc.Operation[HelloInput, HelloOutput]
30-
echo2: nexusrpc.Operation[EchoInput, EchoOutput]
31-
hello2: nexusrpc.Operation[HelloInput, HelloOutput]
32-
echo3: nexusrpc.Operation[EchoInput, EchoOutput]
33-
hello3: nexusrpc.Operation[HelloInput, HelloOutput]
30+
echo: nexusrpc.interface.Operation[EchoInput, EchoOutput]
31+
hello: nexusrpc.interface.Operation[HelloInput, HelloOutput]
32+
echo2: nexusrpc.interface.Operation[EchoInput, EchoOutput]
33+
hello2: nexusrpc.interface.Operation[HelloInput, HelloOutput]
34+
echo3: nexusrpc.interface.Operation[EchoInput, EchoOutput]
35+
hello3: nexusrpc.interface.Operation[HelloInput, HelloOutput]

0 commit comments

Comments
 (0)