Skip to content

Commit 7debab0

Browse files
committed
Respond to upstream: temporal_operation_context
1 parent e302ec2 commit 7debab0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

hello_nexus/basic/handler/service_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
service_handler,
2222
)
2323
from temporalio.nexus.handler import (
24-
TemporalOperationContext,
2524
WorkflowOperationToken,
2625
WorkflowRunOperationHandler,
26+
temporal_operation_context,
2727
)
2828

2929
from hello_nexus.basic.handler.db_client import MyDBClient
@@ -58,7 +58,7 @@ async def start(
5858
ctx: StartOperationContext, input: MyInput
5959
) -> WorkflowOperationToken[MyOutput]:
6060
# You could use self.connected_db_client here.
61-
tctx = TemporalOperationContext.current()
61+
tctx = temporal_operation_context.get()
6262
return await tctx.start_workflow(
6363
WorkflowStartedByNexusOperation.run,
6464
input,

hello_nexus/basic/handler/service_handler_with_operation_handler_classes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class directly.
3333
service_handler,
3434
)
3535
from temporalio.nexus.handler import (
36-
TemporalOperationContext,
3736
cancel_operation,
37+
temporal_operation_context,
3838
)
3939

4040
from hello_nexus.basic.handler.db_client import MyDBClient
@@ -130,7 +130,7 @@ class MyWorkflowRunOperation(OperationHandler[MyInput, MyOutput]):
130130
async def start(
131131
self, ctx: StartOperationContext, input: MyInput
132132
) -> StartOperationResultAsync:
133-
tctx = TemporalOperationContext.current()
133+
tctx = temporal_operation_context.get()
134134
token = await tctx.start_workflow(
135135
WorkflowStartedByNexusOperation.run,
136136
input,

hello_nexus/without_service_definition/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
from temporalio import workflow
1919
from temporalio.client import Client
2020
from temporalio.nexus.handler import (
21-
TemporalOperationContext,
2221
WorkflowOperationToken,
2322
WorkflowRunOperationHandler,
23+
temporal_operation_context,
2424
)
2525
from temporalio.worker import UnsandboxedWorkflowRunner, Worker
2626
from temporalio.workflow import NexusClient
@@ -57,7 +57,7 @@ def my_workflow_run_operation(
5757
async def start(
5858
ctx: StartOperationContext, name: str
5959
) -> WorkflowOperationToken[str]:
60-
tctx = TemporalOperationContext.current()
60+
tctx = temporal_operation_context.get()
6161
return await tctx.start_workflow(
6262
HandlerWorkflow.run,
6363
name,

0 commit comments

Comments
 (0)