Skip to content

Commit 3db333b

Browse files
committed
Rename service class
1 parent 17d9686 commit 3db333b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • hello_nexus/without_service_definition

hello_nexus/without_service_definition/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def run(self, message: str) -> str:
3838
# Here we define a nexus service by providing a service handler implementation without a
3939
# service contract. This nexus service has one operation.
4040
@service_handler
41-
class MyNexusServiceHandler:
41+
class MyNexusService:
4242
# Here we implement a Nexus operation backed by a Temporal workflow. The start
4343
# method must use TemporalOperationContext.start_workflow to start the workflow,
4444
# which returns a WorkflowOperationToken. (Temporal server will then take care of
@@ -70,9 +70,9 @@ async def run(self, message: str) -> str:
7070
# Normally, the first argument to both these calls would reference a service
7171
# contract class, but they can also reference your service handler class, as here.
7272

73-
nexus_client = NexusClient(MyNexusServiceHandler, endpoint=NEXUS_ENDPOINT)
73+
nexus_client = NexusClient(MyNexusService, endpoint=NEXUS_ENDPOINT)
7474
return await nexus_client.execute_operation(
75-
MyNexusServiceHandler.my_workflow_run_operation, message
75+
MyNexusService.my_workflow_run_operation, message
7676
)
7777

7878

@@ -84,7 +84,7 @@ async def execute_caller_workflow(client: Optional[Client] = None) -> str:
8484
client,
8585
task_queue=TASK_QUEUE,
8686
workflows=[CallerWorkflow, HandlerWorkflow],
87-
nexus_service_handlers=[MyNexusServiceHandler()],
87+
nexus_service_handlers=[MyNexusService()],
8888
# TODO(dan): isinstance(op, nexusrpc.contract.Operation) is failing under the
8989
# sandbox in temporalio/worker/_interceptor.py
9090
workflow_runner=UnsandboxedWorkflowRunner(),

0 commit comments

Comments
 (0)