Repository navigation
Record the service of each operation - #58
Open
VegetarianOrc wants to merge 2 commits into
Open
VegetarianOrc wants to merge 2 commits into
VegetarianOrc wants to merge 2 commits into
Conversation
Add Operation.service, which @nexusrpc.service and @service_handler set to the service definition of the decorated class. Callers can then find the service from an operation or a handler method alone. Each decorated class now gets its own operations. A service definition copies inherited operations, and a service handler wraps inherited operation methods, so that an operation reports the service of the class it was accessed on rather than the parent class. Handler method operations now take their name and types from the service definition. Before, a handler for a definition that renames an operation reported the method name instead of the operation name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rewrite the new prose in plain, active-voice English. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VegetarianOrc
marked this pull request as ready for review
October 2, 2026 21:45
|
Can you add a "why" section to the PR description? |
|
And do you see us adding this to all of the Nexus SDKs? |
Collaborator
Author
Spoke offline about this, but at this time I don't think it's necessary for other SDKs as they already have avenues for idiomatic/ergonomic operation targeting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Operation.service.@nexusrpc.serviceand@service_handlerset this value to the service definition of the decorated class. Thus, a caller can find the service from an operation or from a handler method alone.serviceis not part ofOperationequality orrepr.Why
This was added to provide some convenience to targeting operations with Nexus Handler Callbacks in the Temporal Python SDK.
Test plan
uv run poe lint(basedpyright, pyright, mypy, ruff)uv run pytest(112 passed)tests/test_operation_service.pycover definitions, handlers, inheritance, renamed operations, sync and async methods, and@operation_handlerfactories.🤖 Generated with Claude Code