grpcoperator

package
v0.109.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package grpcoperator serves v1.OperatorService, the engine API for operators that run outside the engine process (kind = GRPC in v1_operator). It is the gRPC adapter over internal/services/operatorsvc, which holds the session logic every operator host shares: this package parses the protocol, authenticates the caller, and runs the Listen message loop, and delegates the durable task stream to the dispatcher.

Index

Constants

View Source
const OperatorIdMetadataKey = "hatchet-operator-id"

OperatorIdMetadataKey is the incoming gRPC metadata key that carries the operator id on every RPC after Register (Listen, SendStepActionEvent, DurableTask).

Variables

This section is empty.

Functions

This section is empty.

Types

type OperatorService

type OperatorService interface {
	v1connect.OperatorServiceHandler
	Cleanup() error
}

type OperatorServiceImpl

type OperatorServiceImpl struct {
	v1connect.UnimplementedOperatorServiceHandler
	// contains filtered or unexported fields
}

func (*OperatorServiceImpl) Cleanup

func (s *OperatorServiceImpl) Cleanup() error

Cleanup releases what the service holds between requests.

func (*OperatorServiceImpl) DurableTask

DurableTask is the durable task event stream. The operator is authorized once when the stream opens, and the worker named by the first register_worker message is checked for ownership before the dispatcher sees it; the dispatcher then owns the session. The SDK's durable listener registers exactly once per stream (it opens a new stream to register again), so a second register_worker is refused as a protocol error rather than re-checked: the stream stays bound to the worker it was authorized for.

func (*OperatorServiceImpl) Listen

Listen activates a registered worker for the lifetime of the stream and fans assigned actions out to it. One guarded sender owns the send side of the stream: actions go out through the dispatcher's fan-out and acks go out through the session handle, and both write through it. This goroutine consumes heartbeats, action deltas and pauses.

func (*OperatorServiceImpl) Register

Register upserts the operator by name and creates the worker for this connection, or resumes the worker named by req.WorkerId when it still belongs to the operator. The worker starts with no actions: the client adds them on the Listen stream.

func (*OperatorServiceImpl) SendStepActionEvent

SendStepActionEvent reports task progress for an action delivered on a Listen stream. The event's worker must belong to the calling operator; the dispatcher then handles it exactly like an SDK worker's event.

type OperatorServiceOpt

type OperatorServiceOpt func(*OperatorServiceOpts)

func WithLogger

func WithLogger(l *zerolog.Logger) OperatorServiceOpt

func WithMaxActionsPerOperator

func WithMaxActionsPerOperator(n int64) OperatorServiceOpt

WithMaxActionsPerOperator caps the action links held across all workers of one operator; zero disables the cap.

func WithMaxListenStreamsPerOperator

func WithMaxListenStreamsPerOperator(n int) OperatorServiceOpt

WithMaxListenStreamsPerOperator caps the Listen streams one operator may hold open on this replica; zero disables the cap.

type OperatorServiceOpts

type OperatorServiceOpts struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL