Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions temporal/api/worker/v1/worker_nexus_service_commands.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
syntax = "proto3";

package temporal.api.worker.v1;

option go_package = "go.temporal.io/api/worker/v1;worker";
option java_package = "io.temporal.api.worker.v1";
option java_multiple_files = true;
option java_outer_classname = "WorkerNexusServiceCommandsProto";
option ruby_package = "Temporalio::Api::Worker::V1";
option csharp_namespace = "Temporalio.Api.Worker.V1";

// (--
// Internal Nexus service for server-to-worker communication.
// See worker_service.nexusrpc.yaml for the service definition.
// --)

// Request payload for the "cancel-activities" Nexus operation.
message CancelActivitiesRequest {
// Task tokens identifying the activities to cancel.
repeated bytes task_tokens = 1;
}

// Response payload for the "cancel-activities" Nexus operation.
message CancelActivitiesResponse {
}

25 changes: 25 additions & 0 deletions temporal/api/worker/v1/worker_service.nexusrpc.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if Nexus services should be in a separate place. We don't have a best practice since this is the first one, but maybe a nexus-services/ top-level dir?

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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 worker_nexus_service_commands.proto for protocol details and conventions.
#
# Task queue format: /temporal-sys/worker-commands/{namespace}/{worker_grouping_key}

nexusrpc: 1.0.0

services:
temporal.api.worker.v1.WorkerService:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we have to follow our gRPC naming here. We don't have a best practice since this is the first one, but I think just WorkerControlService is fine or TemporalWorkerControlService (task queue is enough to keep things separated) and similar file name

description: >
Internal Nexus service for server-to-worker communication.
Used by the Temporal server to send commands to workers.
operations:
cancel-activities:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a best practice since this is the first one, but I think camelCase is reasonable, e.g. cancelActivities

description: >
Cancels running activities on a worker. The server sends this when
activities need to be cancelled (e.g., workflow cancellation or
explicit activity cancellation).
input:
$goRef: "go.temporal.io/api/worker/v1.CancelActivitiesRequest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider using JSON schema here and no protos (but if we must use protos, we should reference all languages)

output:
$goRef: "go.temporal.io/api/worker/v1.CancelActivitiesResponse"

Loading