extworker

package
v0.0.0-...-498d591 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: Unlicense Imports: 11 Imported by: 0

Documentation

Overview

Package extworker provides an external worker service and related utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProvisionInfo

func ProvisionInfo(ctx context.Context, endpoint string) (*fnpb.ProvisionInfo, error)

ProvisionInfo returns the runtime provisioning info for the worker.

func WriteWorkerID

func WriteWorkerID(ctx context.Context, id string) context.Context

WriteWorkerID write the worker ID to an outgoing gRPC request context. It merges the information with any existing gRPC metadata.

Types

type Loopback

type Loopback struct {
	fnpb.UnimplementedBeamFnExternalWorkerPoolServer
	// contains filtered or unexported fields
}

Loopback implements fnpb.BeamFnExternalWorkerPoolServer

func StartLoopback

func StartLoopback(ctx context.Context, port int, exec harness.ExecFunc) (*Loopback, error)

StartLoopback initializes a Loopback ExternalWorkerService, at the given port.

func (*Loopback) EnvironmentConfig

func (s *Loopback) EnvironmentConfig(context.Context) string

EnvironmentConfig returns the environment config for this service instance.

func (*Loopback) StartWorker

StartWorker initializes a new worker harness, implementing BeamFnExternalWorkerPoolServer.StartWorker.

func (*Loopback) Stop

func (s *Loopback) Stop(ctx context.Context) error

Stop terminates the service and stops all workers.

func (*Loopback) StopWorker

StopWorker terminates a worker harness, implementing BeamFnExternalWorkerPoolServer.StopWorker.

Jump to

Keyboard shortcuts

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