Skip to content

Commit 1afa91e

Browse files
committed
Respond to upstream
1 parent 0e23c43 commit 1afa91e

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

hello_nexus/simple.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@
55
from temporalio.workflow import NexusClient
66

77

8-
# TODO(dan): make this decorator usable without parens
9-
@nexusrpc.handler.service()
8+
@nexusrpc.handler.service
109
class MyNexusService:
1110
@nexusrpc.handler.sync_operation
1211
async def my_op(self, input: str, _: nexusrpc.handler.StartOperationOptions) -> str:
1312
return f"{input}-result"
1413

1514

16-
@workflow.run
17-
async def run(self, message: str) -> str:
18-
nexus_client = NexusClient(
19-
MyNexusService,
20-
"my-endpoint",
21-
schedule_to_close_timeout=timedelta(seconds=30),
22-
)
23-
return await nexus_client.execute_operation(MyNexusService.my_op, message)
15+
@workflow.defn
16+
class Workflow:
17+
@workflow.run
18+
async def run(self, message: str) -> str:
19+
nexus_client = NexusClient(
20+
MyNexusService,
21+
"my-endpoint",
22+
schedule_to_close_timeout=timedelta(seconds=30),
23+
)
24+
return await nexus_client.execute_operation(MyNexusService.my_op, message)

0 commit comments

Comments
 (0)