1313
1414import uuid
1515
16- from nexusrpc .handler import (
17- StartOperationContext ,
18- service_handler ,
19- sync_operation_handler ,
20- )
16+ from nexusrpc .handler import StartOperationContext , service_handler , sync_operation
2117from temporalio import nexus
22- from temporalio .nexus import workflow_run_operation_handler
18+ from temporalio .nexus import workflow_run_operation
2319
2420from hello_nexus .basic .handler .db_client import MyDBClient
2521from hello_nexus .basic .handler .workflows import WorkflowStartedByNexusOperation
@@ -44,7 +40,7 @@ def __init__(self, connected_db_client: MyDBClient):
4440 #
4541 # The token will be used by the caller if it subsequently wants to cancel the Nexus
4642 # operation.
47- @workflow_run_operation_handler
43+ @workflow_run_operation
4844 async def my_workflow_run_operation (
4945 self , ctx : StartOperationContext , input : MyInput
5046 ) -> nexus .WorkflowHandle [MyOutput ]:
@@ -65,7 +61,7 @@ async def my_workflow_run_operation(
6561 #
6662 # Sync operations are free to make arbitrary network calls, or perform CPU-bound
6763 # computations. Total execution duration must not exceed 10s.
68- @sync_operation_handler
64+ @sync_operation
6965 async def my_sync_operation (
7066 self , ctx : StartOperationContext , input : MyInput
7167 ) -> MyOutput :
0 commit comments