Skip to content

Commit 17d9686

Browse files
committed
Respond to upstream: rename decorators
1 parent b7329d0 commit 17d9686

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

hello_nexus/basic/handler/service_handler.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,9 @@
1313

1414
import 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
2117
from temporalio import nexus
22-
from temporalio.nexus import workflow_run_operation_handler
18+
from temporalio.nexus import workflow_run_operation
2319

2420
from hello_nexus.basic.handler.db_client import MyDBClient
2521
from 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:

hello_nexus/without_service_definition/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
)
1616
from temporalio import nexus, workflow
1717
from temporalio.client import Client
18-
from temporalio.nexus import workflow_run_operation_handler
18+
from temporalio.nexus import workflow_run_operation
1919
from temporalio.worker import UnsandboxedWorkflowRunner, Worker
2020
from temporalio.workflow import NexusClient
2121

@@ -44,7 +44,7 @@ class MyNexusServiceHandler:
4444
# which returns a WorkflowOperationToken. (Temporal server will then take care of
4545
# delivering the workflow result to the caller, using the Nexus RPC callback
4646
# mechanism).
47-
@workflow_run_operation_handler
47+
@workflow_run_operation
4848
async def my_workflow_run_operation(
4949
self, ctx: StartOperationContext, name: str
5050
) -> nexus.WorkflowHandle[str]:

0 commit comments

Comments
 (0)