File tree Expand file tree Collapse file tree
nexus_messaging/ondemandpattern Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ operations. `NexusRemoteGreetingService` adds a `run_from_remote` operation that
66instance to target.
77
88The caller Workflow:
9- 1 . Starts two remote ` GreetingWorkflow ` instances via ` run_from_remote ` (backed by ` workflow_run_operation ` )
9+ 1 . Starts two remote ` GreetingWorkflow ` instances via ` run_from_remote ` (backed by ` temporal_operation ` )
10102 . Queries each for supported languages
11113 . Changes the language on each (Arabic and Hindi)
12124 . Confirms the changes via queries
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ async def run(self) -> list[str]:
4040
4141 # This is an async Nexus operation -- starts a workflow on the handler and
4242 # returns a handle. Unlike the sync operations below, this does not block
43- # until the workflow completes. It is backed by workflow_run_operation on the
43+ # until the workflow completes. It is backed by temporal_operation on the
4444 # handler side.
4545 handle_one = await self .nexus_client .start_operation (
4646 NexusRemoteGreetingService .run_from_remote ,
Original file line number Diff line number Diff line change @@ -40,12 +40,15 @@ def _get_workflow_handle(
4040 )
4141
4242 # Starts a new GreetingWorkflow with the caller-specified user ID.
43- # This is an async Nexus operation backed by workflow_run_operation .
44- @nexus .workflow_run_operation
43+ # This is an async Nexus operation backed by temporal_operation .
44+ @nexus .temporal_operation
4545 async def run_from_remote (
46- self , ctx : nexus .WorkflowRunOperationContext , input : RunFromRemoteInput
47- ) -> nexus .WorkflowHandle [str ]:
48- return await ctx .start_workflow (
46+ self ,
47+ _ctx : nexus .TemporalStartOperationContext ,
48+ client : nexus .TemporalNexusClient ,
49+ input : RunFromRemoteInput ,
50+ ) -> nexus .TemporalOperationResult [str ]:
51+ return await client .start_workflow (
4952 GreetingWorkflow .run ,
5053 id = self ._get_workflow_id (input .user_id ),
5154 )
You can’t perform that action at this time.
0 commit comments