Skip to content

Commit 18e268a

Browse files
committed
Cleanup
1 parent 88cdd10 commit 18e268a

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

temporalio/worker/_nexus.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def __init__(
7171
def _validate_nexus_services(
7272
self, nexus_services: Sequence[Any]
7373
) -> dict[str, dict[str, nexusrpc.handler.Operation]]:
74-
# TODO(dan): Fail if multiple services implement the same service interface.
74+
# TODO(dan): Fail if multiple services have the same name.
7575
nexus_services_by_name: dict[str, dict[str, nexusrpc.handler.Operation]] = {}
7676
for service in nexus_services:
7777
defn = nexusrpc.handler.NexusServiceDefinition.from_implementation(service)
@@ -217,11 +217,6 @@ async def _handle_start_operation(
217217
print(
218218
f"🟢 Nexus operation {request.operation} started with async response {result}"
219219
)
220-
# TODO(dan): is it not valid to instantiate proto objects with an argument?
221-
# "When called, it accepts no arguments and returns a new featureless instance
222-
# that has no instance attributes and cannot be given any.""
223-
224-
# TODO(dan): python proto instantiation
225220
op_resp = temporalio.api.nexus.v1.StartOperationResponse(
226221
async_success=temporalio.api.nexus.v1.StartOperationResponse.Async(
227222
operation_token=result.token,
@@ -243,7 +238,6 @@ async def _handle_start_operation(
243238
)
244239
completion = temporalio.bridge.proto.nexus.NexusTaskCompletion(
245240
task_token=task_token,
246-
# TODO(dan): python proto instantiation
247241
completed=temporalio.api.nexus.v1.Response(start_operation=op_resp),
248242
)
249243
await self._bridge_worker().complete_nexus_task(completion)
@@ -269,7 +263,6 @@ async def _handle_cancel_operation(
269263
# TODO(dan): HandlerError
270264
completion = temporalio.bridge.proto.nexus.NexusTaskCompletion(
271265
task_token=task_token,
272-
# TODO(dan): python proto instantiation
273266
completed=temporalio.api.nexus.v1.Response(
274267
cancel_operation=temporalio.api.nexus.v1.CancelOperationResponse()
275268
),

tests/worker/test_nexus.py

+3
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,9 @@ class ServiceClassNameOutput:
668668

669669

670670
# TODO(dan): test interface op types not matching
671+
# TODO(dan): test multiple registered services with the same name
672+
# TODO(dan): test no such registered service
673+
# TODO(dan): test no such registered operation
671674

672675

673676
@nexusrpc.interface.service

0 commit comments

Comments
 (0)