From 582647e8810f445762de855b54c4eea7aa24a5e0 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Wed, 10 Sep 2025 12:03:04 -0700 Subject: [PATCH 1/5] Add nexus multiple args sample --- nexus_multiple_args/README.md | 33 ++++++++++++ nexus_multiple_args/__init__.py | 0 nexus_multiple_args/caller/__init__.py | 0 nexus_multiple_args/caller/app.py | 54 +++++++++++++++++++ nexus_multiple_args/caller/workflows.py | 30 +++++++++++ nexus_multiple_args/handler/__init__.py | 0 .../handler/service_handler.py | 40 ++++++++++++++ nexus_multiple_args/handler/worker.py | 45 ++++++++++++++++ nexus_multiple_args/handler/workflows.py | 32 +++++++++++ nexus_multiple_args/service.py | 43 +++++++++++++++ tests/hello_nexus/hello_nexus_test.py | 2 +- tests/helpers/__init__.py | 0 .../helpers.py => helpers/nexus.py} | 2 +- tests/nexus_multiple_args/__init__.py | 0 .../nexus_multiple_args_test.py | 50 +++++++++++++++++ 15 files changed, 329 insertions(+), 2 deletions(-) create mode 100644 nexus_multiple_args/README.md create mode 100644 nexus_multiple_args/__init__.py create mode 100644 nexus_multiple_args/caller/__init__.py create mode 100644 nexus_multiple_args/caller/app.py create mode 100644 nexus_multiple_args/caller/workflows.py create mode 100644 nexus_multiple_args/handler/__init__.py create mode 100644 nexus_multiple_args/handler/service_handler.py create mode 100644 nexus_multiple_args/handler/worker.py create mode 100644 nexus_multiple_args/handler/workflows.py create mode 100644 nexus_multiple_args/service.py create mode 100644 tests/helpers/__init__.py rename tests/{hello_nexus/helpers.py => helpers/nexus.py} (99%) create mode 100644 tests/nexus_multiple_args/__init__.py create mode 100644 tests/nexus_multiple_args/nexus_multiple_args_test.py diff --git a/nexus_multiple_args/README.md b/nexus_multiple_args/README.md new file mode 100644 index 00000000..8da0f146 --- /dev/null +++ b/nexus_multiple_args/README.md @@ -0,0 +1,33 @@ +This sample shows how to map a Nexus operation to a handler workflow that takes multiple input arguments. The Nexus operation receives a single input object but unpacks it into multiple arguments when starting the workflow. + +### Sample directory structure + +- [service.py](./service.py) - shared Nexus service definition +- [caller](./caller) - a caller workflow that executes Nexus operations, together with a worker and starter code +- [handler](./handler) - Nexus operation handlers, together with a workflow used by the Nexus operation, and a worker that polls for both workflow and Nexus tasks. + +### Instructions + +Start a Temporal server. (See the main samples repo [README](../README.md)). + +Run the following: + +``` +temporal operator namespace create --namespace nexus-multiple-args-handler-namespace +temporal operator namespace create --namespace nexus-multiple-args-caller-namespace + +temporal operator nexus endpoint create \ + --name nexus-multiple-args-nexus-endpoint \ + --target-namespace nexus-multiple-args-handler-namespace \ + --target-task-queue nexus-multiple-args-handler-task-queue +``` + +In one terminal, run the Temporal worker in the handler namespace: +``` +uv run nexus_multiple_args/handler/worker.py +``` + +In another terminal, run the Temporal worker in the caller namespace and start the caller workflow: +``` +uv run nexus_multiple_args/caller/app.py +``` \ No newline at end of file diff --git a/nexus_multiple_args/__init__.py b/nexus_multiple_args/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nexus_multiple_args/caller/__init__.py b/nexus_multiple_args/caller/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nexus_multiple_args/caller/app.py b/nexus_multiple_args/caller/app.py new file mode 100644 index 00000000..7c37771d --- /dev/null +++ b/nexus_multiple_args/caller/app.py @@ -0,0 +1,54 @@ +import asyncio +import uuid +from typing import Optional + +from temporalio.client import Client +from temporalio.worker import Worker + +from nexus_multiple_args.caller.workflows import CallerWorkflow +from nexus_multiple_args.service import Language + +NAMESPACE = "nexus-multiple-args-caller-namespace" +TASK_QUEUE = "nexus-multiple-args-caller-task-queue" + + +async def execute_caller_workflow( + client: Optional[Client] = None, +) -> tuple[str, str]: + client = client or await Client.connect( + "localhost:7233", + namespace=NAMESPACE, + ) + + async with Worker( + client, + task_queue=TASK_QUEUE, + workflows=[CallerWorkflow], + ): + # Execute workflow with English language + result1 = await client.execute_workflow( + CallerWorkflow.run, + args=["Nexus", Language.EN], + id=str(uuid.uuid4()), + task_queue=TASK_QUEUE, + ) + + # Execute workflow with Spanish language + result2 = await client.execute_workflow( + CallerWorkflow.run, + args=["Nexus", Language.ES], + id=str(uuid.uuid4()), + task_queue=TASK_QUEUE, + ) + + return result1, result2 + + +if __name__ == "__main__": + loop = asyncio.new_event_loop() + try: + results = loop.run_until_complete(execute_caller_workflow()) + for result in results: + print(result) + except KeyboardInterrupt: + loop.run_until_complete(loop.shutdown_asyncgens()) diff --git a/nexus_multiple_args/caller/workflows.py b/nexus_multiple_args/caller/workflows.py new file mode 100644 index 00000000..60d2b991 --- /dev/null +++ b/nexus_multiple_args/caller/workflows.py @@ -0,0 +1,30 @@ +from temporalio import workflow + +with workflow.unsafe.imports_passed_through(): + from nexus_multiple_args.service import HelloInput, Language, MyNexusService + +NEXUS_ENDPOINT = "nexus-multiple-args-nexus-endpoint" + + +# This is a workflow that calls a nexus operation with multiple arguments. +@workflow.defn +class CallerWorkflow: + # An __init__ method is always optional on a workflow class. Here we use it to set the + # nexus client, but that could alternatively be done in the run method. + def __init__(self): + self.nexus_client = workflow.create_nexus_client( + service=MyNexusService, + endpoint=NEXUS_ENDPOINT, + ) + + # The workflow run method demonstrates calling a nexus operation with multiple arguments + # packed into an input object. + @workflow.run + async def run(self, name: str, language: Language) -> str: + # Start the nexus operation and wait for the result in one go, using execute_operation. + # The multiple arguments (name and language) are packed into a HelloInput object. + result = await self.nexus_client.execute_operation( + MyNexusService.hello, + HelloInput(name=name, language=language), + ) + return result.message diff --git a/nexus_multiple_args/handler/__init__.py b/nexus_multiple_args/handler/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/nexus_multiple_args/handler/service_handler.py b/nexus_multiple_args/handler/service_handler.py new file mode 100644 index 00000000..af9a64fe --- /dev/null +++ b/nexus_multiple_args/handler/service_handler.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +import uuid + +import nexusrpc +from temporalio import nexus + +from nexus_multiple_args.handler.workflows import HelloHandlerWorkflow +from nexus_multiple_args.service import ( + HelloInput, + HelloOutput, + MyNexusService, +) + + +@nexusrpc.handler.service_handler(service=MyNexusService) +class MyNexusServiceHandler: + """ + Service handler that demonstrates multiple argument handling in Nexus operations. + """ + + # This is a nexus operation that is backed by a Temporal workflow. + # The key feature here is that it demonstrates how to map a single input object + # (HelloInput) to a workflow that takes multiple individual arguments. + # This is equivalent to the Java WorkflowRunOperation.fromWorkflowHandle pattern. + @nexus.workflow_run_operation + async def hello( + self, ctx: nexus.WorkflowRunOperationContext, input: HelloInput + ) -> nexus.WorkflowHandle[HelloOutput]: + """ + Start a workflow with multiple arguments unpacked from the input object. + """ + return await ctx.start_workflow( + HelloHandlerWorkflow.run, + args=[ + input.name, # First argument: name + input.language, # Second argument: language + ], + id=str(uuid.uuid4()), + ) diff --git a/nexus_multiple_args/handler/worker.py b/nexus_multiple_args/handler/worker.py new file mode 100644 index 00000000..a7ce20ce --- /dev/null +++ b/nexus_multiple_args/handler/worker.py @@ -0,0 +1,45 @@ +import asyncio +import logging +from typing import Optional + +from temporalio.client import Client +from temporalio.worker import Worker + +from nexus_multiple_args.handler.service_handler import MyNexusServiceHandler +from nexus_multiple_args.handler.workflows import HelloHandlerWorkflow + +interrupt_event = asyncio.Event() + +NAMESPACE = "nexus-multiple-args-handler-namespace" +TASK_QUEUE = "nexus-multiple-args-handler-task-queue" + + +async def main(client: Optional[Client] = None): + logging.basicConfig(level=logging.INFO) + + client = client or await Client.connect( + "localhost:7233", + namespace=NAMESPACE, + ) + + # Start the worker, passing the Nexus service handler instance, in addition to the + # workflow classes that are started by your nexus operations, and any activities + # needed. This Worker will poll for both workflow tasks and Nexus tasks. + async with Worker( + client, + task_queue=TASK_QUEUE, + workflows=[HelloHandlerWorkflow], + nexus_service_handlers=[MyNexusServiceHandler()], + ): + logging.info("Worker started, ctrl+c to exit") + await interrupt_event.wait() + logging.info("Shutting down") + + +if __name__ == "__main__": + loop = asyncio.new_event_loop() + try: + loop.run_until_complete(main()) + except KeyboardInterrupt: + interrupt_event.set() + loop.run_until_complete(loop.shutdown_asyncgens()) \ No newline at end of file diff --git a/nexus_multiple_args/handler/workflows.py b/nexus_multiple_args/handler/workflows.py new file mode 100644 index 00000000..b3c8cdbc --- /dev/null +++ b/nexus_multiple_args/handler/workflows.py @@ -0,0 +1,32 @@ +from temporalio import workflow + +with workflow.unsafe.imports_passed_through(): + from nexus_multiple_args.service import HelloInput, HelloOutput, Language + + +# This is the workflow that is started by the `hello` nexus operation. +# It demonstrates handling multiple arguments passed from the Nexus service. +@workflow.defn +class HelloHandlerWorkflow: + @workflow.run + async def run(self, name: str, language: Language) -> HelloOutput: + """ + Handle the hello workflow with multiple arguments. + + This method receives the individual arguments (name and language) + that were unpacked from the HelloInput in the service handler. + """ + if language == Language.EN: + message = f"Hello {name} πŸ‘‹" + elif language == Language.FR: + message = f"Bonjour {name} πŸ‘‹" + elif language == Language.DE: + message = f"Hallo {name} πŸ‘‹" + elif language == Language.ES: + message = f"Β‘Hola! {name} πŸ‘‹" + elif language == Language.TR: + message = f"Merhaba {name} πŸ‘‹" + else: + raise ValueError(f"Unsupported language: {language}") + + return HelloOutput(message=message) \ No newline at end of file diff --git a/nexus_multiple_args/service.py b/nexus_multiple_args/service.py new file mode 100644 index 00000000..b92f75a4 --- /dev/null +++ b/nexus_multiple_args/service.py @@ -0,0 +1,43 @@ +""" +This is a Nexus service definition that demonstrates multiple argument handling. + +A service definition defines a Nexus service as a named collection of operations, each +with input and output types. It does not implement operation handling: see the service +handler and operation handlers in nexus_multiple_args.handler.service_handler for that. + +A Nexus service definition is used by Nexus callers (e.g. a Temporal workflow) to create +type-safe clients, and it is used by Nexus handlers to validate that they implement +correctly-named operation handlers with the correct input and output types. + +The service defined in this file features one operation: hello, where hello +demonstrates handling multiple arguments through a single input object. +""" + +from dataclasses import dataclass +from enum import StrEnum + +import nexusrpc + + +class Language(StrEnum): + EN = "EN" + FR = "FR" + DE = "DE" + ES = "ES" + TR = "TR" + + +@dataclass +class HelloInput: + name: str + language: Language + + +@dataclass +class HelloOutput: + message: str + + +@nexusrpc.service +class MyNexusService: + hello: nexusrpc.Operation[HelloInput, HelloOutput] diff --git a/tests/hello_nexus/hello_nexus_test.py b/tests/hello_nexus/hello_nexus_test.py index f9a8807d..fecfe17c 100644 --- a/tests/hello_nexus/hello_nexus_test.py +++ b/tests/hello_nexus/hello_nexus_test.py @@ -8,7 +8,7 @@ import hello_nexus.caller.app import hello_nexus.caller.workflows import hello_nexus.handler.worker -from tests.hello_nexus.helpers import create_nexus_endpoint, delete_nexus_endpoint +from tests.helpers.nexus import create_nexus_endpoint, delete_nexus_endpoint async def test_nexus_service_basic(client: Client, env: WorkflowEnvironment): diff --git a/tests/helpers/__init__.py b/tests/helpers/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/hello_nexus/helpers.py b/tests/helpers/nexus.py similarity index 99% rename from tests/hello_nexus/helpers.py rename to tests/helpers/nexus.py index dee8dc18..dc8288c5 100644 --- a/tests/hello_nexus/helpers.py +++ b/tests/helpers/nexus.py @@ -36,4 +36,4 @@ async def delete_nexus_endpoint( id=id, version=version, ) - ) + ) \ No newline at end of file diff --git a/tests/nexus_multiple_args/__init__.py b/tests/nexus_multiple_args/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/nexus_multiple_args/nexus_multiple_args_test.py b/tests/nexus_multiple_args/nexus_multiple_args_test.py new file mode 100644 index 00000000..682b8f20 --- /dev/null +++ b/tests/nexus_multiple_args/nexus_multiple_args_test.py @@ -0,0 +1,50 @@ +import asyncio +import sys + +import pytest +from temporalio.client import Client +from temporalio.testing import WorkflowEnvironment + +import nexus_multiple_args.caller.app +import nexus_multiple_args.caller.workflows +import nexus_multiple_args.handler.worker +from tests.helpers.nexus import create_nexus_endpoint, delete_nexus_endpoint + + +async def test_nexus_multiple_args(client: Client, env: WorkflowEnvironment): + if env.supports_time_skipping: + pytest.skip("Nexus tests don't work under the Java test server") + + if sys.version_info[:2] < (3, 10): + pytest.skip("Sample is written for Python >= 3.10") + + create_response = await create_nexus_endpoint( + name=nexus_multiple_args.caller.workflows.NEXUS_ENDPOINT, + task_queue=nexus_multiple_args.handler.worker.TASK_QUEUE, + client=client, + ) + try: + handler_worker_task = asyncio.create_task( + nexus_multiple_args.handler.worker.main( + client, + ) + ) + await asyncio.sleep(1) + results = await nexus_multiple_args.caller.app.execute_caller_workflow( + client, + ) + nexus_multiple_args.handler.worker.interrupt_event.set() + await handler_worker_task + nexus_multiple_args.handler.worker.interrupt_event.clear() + + # Verify the expected output messages + assert results == ( + "Hello Nexus πŸ‘‹", + "Β‘Hola! Nexus πŸ‘‹", + ) + finally: + await delete_nexus_endpoint( + id=create_response.endpoint.id, + version=create_response.endpoint.version, + client=client, + ) From 800c123217c73af47c64f783e37d2ce109f9602a Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Wed, 10 Sep 2025 12:06:51 -0700 Subject: [PATCH 2/5] Autoformat --- nexus_multiple_args/handler/service_handler.py | 6 +----- nexus_multiple_args/handler/worker.py | 2 +- nexus_multiple_args/handler/workflows.py | 8 ++++---- tests/helpers/nexus.py | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/nexus_multiple_args/handler/service_handler.py b/nexus_multiple_args/handler/service_handler.py index af9a64fe..7b8014b4 100644 --- a/nexus_multiple_args/handler/service_handler.py +++ b/nexus_multiple_args/handler/service_handler.py @@ -6,11 +6,7 @@ from temporalio import nexus from nexus_multiple_args.handler.workflows import HelloHandlerWorkflow -from nexus_multiple_args.service import ( - HelloInput, - HelloOutput, - MyNexusService, -) +from nexus_multiple_args.service import HelloInput, HelloOutput, MyNexusService @nexusrpc.handler.service_handler(service=MyNexusService) diff --git a/nexus_multiple_args/handler/worker.py b/nexus_multiple_args/handler/worker.py index a7ce20ce..d12a7ee1 100644 --- a/nexus_multiple_args/handler/worker.py +++ b/nexus_multiple_args/handler/worker.py @@ -42,4 +42,4 @@ async def main(client: Optional[Client] = None): loop.run_until_complete(main()) except KeyboardInterrupt: interrupt_event.set() - loop.run_until_complete(loop.shutdown_asyncgens()) \ No newline at end of file + loop.run_until_complete(loop.shutdown_asyncgens()) diff --git a/nexus_multiple_args/handler/workflows.py b/nexus_multiple_args/handler/workflows.py index b3c8cdbc..2082e8ba 100644 --- a/nexus_multiple_args/handler/workflows.py +++ b/nexus_multiple_args/handler/workflows.py @@ -12,8 +12,8 @@ class HelloHandlerWorkflow: async def run(self, name: str, language: Language) -> HelloOutput: """ Handle the hello workflow with multiple arguments. - - This method receives the individual arguments (name and language) + + This method receives the individual arguments (name and language) that were unpacked from the HelloInput in the service handler. """ if language == Language.EN: @@ -28,5 +28,5 @@ async def run(self, name: str, language: Language) -> HelloOutput: message = f"Merhaba {name} πŸ‘‹" else: raise ValueError(f"Unsupported language: {language}") - - return HelloOutput(message=message) \ No newline at end of file + + return HelloOutput(message=message) diff --git a/tests/helpers/nexus.py b/tests/helpers/nexus.py index dc8288c5..dee8dc18 100644 --- a/tests/helpers/nexus.py +++ b/tests/helpers/nexus.py @@ -36,4 +36,4 @@ async def delete_nexus_endpoint( id=id, version=version, ) - ) \ No newline at end of file + ) From e2a05960ecc3fd24d05a83f94677c602f6303403 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Wed, 10 Sep 2025 12:13:42 -0700 Subject: [PATCH 3/5] Ugh, StrEnum only 3.11 --- nexus_multiple_args/caller/app.py | 5 ++--- nexus_multiple_args/caller/workflows.py | 4 ++-- nexus_multiple_args/handler/workflows.py | 14 +++++++------- nexus_multiple_args/service.py | 11 +---------- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/nexus_multiple_args/caller/app.py b/nexus_multiple_args/caller/app.py index 7c37771d..88aadbf9 100644 --- a/nexus_multiple_args/caller/app.py +++ b/nexus_multiple_args/caller/app.py @@ -6,7 +6,6 @@ from temporalio.worker import Worker from nexus_multiple_args.caller.workflows import CallerWorkflow -from nexus_multiple_args.service import Language NAMESPACE = "nexus-multiple-args-caller-namespace" TASK_QUEUE = "nexus-multiple-args-caller-task-queue" @@ -28,7 +27,7 @@ async def execute_caller_workflow( # Execute workflow with English language result1 = await client.execute_workflow( CallerWorkflow.run, - args=["Nexus", Language.EN], + args=["Nexus", "en"], id=str(uuid.uuid4()), task_queue=TASK_QUEUE, ) @@ -36,7 +35,7 @@ async def execute_caller_workflow( # Execute workflow with Spanish language result2 = await client.execute_workflow( CallerWorkflow.run, - args=["Nexus", Language.ES], + args=["Nexus", "es"], id=str(uuid.uuid4()), task_queue=TASK_QUEUE, ) diff --git a/nexus_multiple_args/caller/workflows.py b/nexus_multiple_args/caller/workflows.py index 60d2b991..940a032f 100644 --- a/nexus_multiple_args/caller/workflows.py +++ b/nexus_multiple_args/caller/workflows.py @@ -1,7 +1,7 @@ from temporalio import workflow with workflow.unsafe.imports_passed_through(): - from nexus_multiple_args.service import HelloInput, Language, MyNexusService + from nexus_multiple_args.service import HelloInput, MyNexusService NEXUS_ENDPOINT = "nexus-multiple-args-nexus-endpoint" @@ -20,7 +20,7 @@ def __init__(self): # The workflow run method demonstrates calling a nexus operation with multiple arguments # packed into an input object. @workflow.run - async def run(self, name: str, language: Language) -> str: + async def run(self, name: str, language: str) -> str: # Start the nexus operation and wait for the result in one go, using execute_operation. # The multiple arguments (name and language) are packed into a HelloInput object. result = await self.nexus_client.execute_operation( diff --git a/nexus_multiple_args/handler/workflows.py b/nexus_multiple_args/handler/workflows.py index 2082e8ba..15bd0824 100644 --- a/nexus_multiple_args/handler/workflows.py +++ b/nexus_multiple_args/handler/workflows.py @@ -1,7 +1,7 @@ from temporalio import workflow with workflow.unsafe.imports_passed_through(): - from nexus_multiple_args.service import HelloInput, HelloOutput, Language + from nexus_multiple_args.service import HelloOutput # This is the workflow that is started by the `hello` nexus operation. @@ -9,22 +9,22 @@ @workflow.defn class HelloHandlerWorkflow: @workflow.run - async def run(self, name: str, language: Language) -> HelloOutput: + async def run(self, name: str, language: str) -> HelloOutput: """ Handle the hello workflow with multiple arguments. This method receives the individual arguments (name and language) that were unpacked from the HelloInput in the service handler. """ - if language == Language.EN: + if language == "en": message = f"Hello {name} πŸ‘‹" - elif language == Language.FR: + elif language == "fr": message = f"Bonjour {name} πŸ‘‹" - elif language == Language.DE: + elif language == "de": message = f"Hallo {name} πŸ‘‹" - elif language == Language.ES: + elif language == "es": message = f"Β‘Hola! {name} πŸ‘‹" - elif language == Language.TR: + elif language == "tr": message = f"Merhaba {name} πŸ‘‹" else: raise ValueError(f"Unsupported language: {language}") diff --git a/nexus_multiple_args/service.py b/nexus_multiple_args/service.py index b92f75a4..ccae11fd 100644 --- a/nexus_multiple_args/service.py +++ b/nexus_multiple_args/service.py @@ -14,23 +14,14 @@ """ from dataclasses import dataclass -from enum import StrEnum import nexusrpc -class Language(StrEnum): - EN = "EN" - FR = "FR" - DE = "DE" - ES = "ES" - TR = "TR" - - @dataclass class HelloInput: name: str - language: Language + language: str @dataclass From 1836a6adefdbbecd51ebe4607b8e57c1463c2efa Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Wed, 10 Sep 2025 13:20:45 -0700 Subject: [PATCH 4/5] Remove pointless comment --- nexus_multiple_args/handler/service_handler.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nexus_multiple_args/handler/service_handler.py b/nexus_multiple_args/handler/service_handler.py index 7b8014b4..adc6d382 100644 --- a/nexus_multiple_args/handler/service_handler.py +++ b/nexus_multiple_args/handler/service_handler.py @@ -18,7 +18,6 @@ class MyNexusServiceHandler: # This is a nexus operation that is backed by a Temporal workflow. # The key feature here is that it demonstrates how to map a single input object # (HelloInput) to a workflow that takes multiple individual arguments. - # This is equivalent to the Java WorkflowRunOperation.fromWorkflowHandle pattern. @nexus.workflow_run_operation async def hello( self, ctx: nexus.WorkflowRunOperationContext, input: HelloInput From 3d64a858e40963397ac088a7edfd626c68290d47 Mon Sep 17 00:00:00 2001 From: Spencer Judge Date: Wed, 10 Sep 2025 13:45:12 -0700 Subject: [PATCH 5/5] Add snipsync --- nexus_multiple_args/handler/service_handler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nexus_multiple_args/handler/service_handler.py b/nexus_multiple_args/handler/service_handler.py index adc6d382..c2ddfb92 100644 --- a/nexus_multiple_args/handler/service_handler.py +++ b/nexus_multiple_args/handler/service_handler.py @@ -9,6 +9,7 @@ from nexus_multiple_args.service import HelloInput, HelloOutput, MyNexusService +# @@@SNIPSTART samples-python-nexus-handler-multiargs @nexusrpc.handler.service_handler(service=MyNexusService) class MyNexusServiceHandler: """ @@ -33,3 +34,6 @@ async def hello( ], id=str(uuid.uuid4()), ) + + +# @@@SNIPEND