-
Notifications
You must be signed in to change notification settings - Fork 88
Add Nexus worker service for server-to-worker commands #708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: kannan/add-worker-instance-key-to-wft-complete
Are you sure you want to change the base?
Changes from all commits
22ab5e7
e9d56b9
1643b18
c5a0a89
6f53c22
6c21af4
8506d65
5074e8a
f06f149
09ee5c4
ab6c53b
106652b
9f19af6
32523fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,46 @@ | ||||||
| syntax = "proto3"; | ||||||
|
|
||||||
| package temporal.api.nexusservices.workerservice.v1; | ||||||
|
|
||||||
| option go_package = "go.temporal.io/api/nexusservices/workerservice/v1;workerservice"; | ||||||
| option java_package = "io.temporal.api.nexusservices.workerservice.v1"; | ||||||
| option java_multiple_files = true; | ||||||
| option java_outer_classname = "RequestResponseProto"; | ||||||
| option ruby_package = "Temporalio::Api::Nexusservices::Workerservice::V1"; | ||||||
| option csharp_namespace = "Temporalio.Api.Nexusservices.Workerservice.V1"; | ||||||
|
|
||||||
| // (-- | ||||||
| // Internal Nexus service for server-to-worker communication. | ||||||
| // See service.yaml for the service definition. | ||||||
| // --) | ||||||
|
|
||||||
| // Request payload for the "executeCommands" Nexus operation. | ||||||
| message WorkerCommandsRequest { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the API is called
Suggested change
|
||||||
| repeated WorkerCommand commands = 1; | ||||||
|
|
||||||
| message WorkerCommand { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would pull this out to a top level message and put it in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But since this is a new nexus service, shouldn't this be decoupled from the existing gRPC Do we know what other contexts we might want to use this message, or is that hypothetical? |
||||||
| oneof type { | ||||||
| CancelActivity cancel_activity = 1; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| // Cancel an activity if it is still running. Otherwise, do nothing. | ||||||
| message CancelActivity { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, make this a top level |
||||||
| bytes task_token = 1; | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| // Response payload for the "executeCommands" Nexus operation. | ||||||
| message WorkerCommandsResponse { | ||||||
| repeated WorkerCommandResult results = 1; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should document the expectation (at least, what I assume is the expectation... hence the need for a docstrings) that this results list must be 1:1 with the request list, of the same size and order. |
||||||
|
|
||||||
| message WorkerCommandResult { | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||||||
| oneof type { | ||||||
| CancelActivity cancel_activity = 1; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
| } | ||||||
| } | ||||||
|
|
||||||
| // Treat both successful cancellation and no-op (activity is no longer running) as success. | ||||||
| message CancelActivity { | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/nexus-rpc/nexus-rpc-gen/main/schemas/nexus-rpc-gen.json | ||||||
| # | ||||||
| # Nexus service definition for server-to-worker communication. | ||||||
| # See request_response.proto for message definitions. | ||||||
| # | ||||||
| # Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key} | ||||||
|
|
||||||
| nexusrpc: 1.0.0 | ||||||
|
|
||||||
| services: | ||||||
| temporal.api.nexusservices.workerservice.v1.WorkerService: | ||||||
| description: > | ||||||
| Internal Nexus service for server-to-worker communication. | ||||||
| Used by the Temporal server to send commands to workers. | ||||||
| operations: | ||||||
| executeCommands: | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| description: Executes worker commands sent by the server. | ||||||
| input: | ||||||
| $goRef: "go.temporal.io/api/nexusservices/workerservice/v1.WorkerCommandsRequest" | ||||||
| $javaRef: "io.temporal.api.nexusservices.workerservice.v1.WorkerCommandsRequest" | ||||||
| $pythonRef: "temporalio.api.nexusservices.workerservice.v1.WorkerCommandsRequest" | ||||||
| $typescriptRef: "@temporalio/api/nexusservices/workerservice/v1.WorkerCommandsRequest" | ||||||
| $dotnetRef: "Temporalio.Api.Nexusservices.Workerservice.V1.WorkerCommandsRequest" | ||||||
| $rubyRef: "Temporalio::Api::Nexusservices::Workerservice::V1::WorkerCommandsRequest" | ||||||
| output: | ||||||
| $goRef: "go.temporal.io/api/nexusservices/workerservice/v1.WorkerCommandsResponse" | ||||||
| $javaRef: "io.temporal.api.nexusservices.workerservice.v1.WorkerCommandsResponse" | ||||||
| $pythonRef: "temporalio.api.nexusservices.workerservice.v1.WorkerCommandsResponse" | ||||||
| $typescriptRef: "@temporalio/api/nexusservices/workerservice/v1.WorkerCommandsResponse" | ||||||
| $dotnetRef: "Temporalio.Api.Nexusservices.Workerservice.V1.WorkerCommandsResponse" | ||||||
| $rubyRef: "Temporalio::Api::Nexusservices::Workerservice::V1::WorkerCommandsResponse" | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.