pool

package
v2.63.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Overview

Package pool facilitates a external worker service, as an alternate mode for the standard Beam container.

This is predeominantly to serve as a process spawner within a given container VM for an arbitrary number of jobs, instead of for a single worker instance.

Workers will be spawned as executed OS processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

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

Process implements fnpb.BeamFnExternalWorkerPoolServer, by starting external processes.

func New

func New(ctx context.Context, port int, containerExecutable string) (*Process, error)

New initializes a process based ExternalWorkerService, at the given port.

func (*Process) ServeAndWait

func (s *Process) ServeAndWait() error

ServeAndWait starts the ExternalWorkerService and blocks until exit.

func (*Process) StartWorker

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

func (*Process) Stop

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

Stop terminates the service and stops all workers.

func (*Process) 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