Skip to content

Commit 2f36e1a

Browse files
authored
Invoke workflow-backed op in two-stage style (#242)
1 parent 0cae313 commit 2f36e1a

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

hello_nexus/caller/workflows.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ def __init__(self):
2121
@workflow.run
2222
async def run(self, name: str) -> tuple[MyOutput, MyOutput]:
2323
# Start the nexus operation and wait for the result in one go, using execute_operation.
24-
wf_result = await self.nexus_client.execute_operation(
25-
MyNexusService.my_workflow_run_operation,
24+
op_1_result = await self.nexus_client.execute_operation(
25+
MyNexusService.my_sync_operation,
2626
MyInput(name),
2727
)
2828
# Alternatively, you can use start_operation to obtain the operation handle and
2929
# then `await` the handle to obtain the result.
30-
sync_operation_handle = await self.nexus_client.start_operation(
31-
MyNexusService.my_sync_operation,
30+
op_2_handle = await self.nexus_client.start_operation(
31+
MyNexusService.my_workflow_run_operation,
3232
MyInput(name),
3333
)
34-
sync_result = await sync_operation_handle
35-
return sync_result, wf_result
34+
op_2_result = await op_2_handle
35+
return op_1_result, op_2_result

0 commit comments

Comments
 (0)