worker

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NamePool added in v0.0.30

func NamePool(lang string) []string

func PickRandomName added in v0.0.30

func PickRandomName(pool []string, used map[string]struct{}) (string, bool)

Types

type CreateWorkerParams added in v0.0.22

type CreateWorkerParams struct {
	Name             string
	Description      string
	Constraints      string
	WorkDir          string
	PermissionScopes string
	Engine           string
}

CreateWorkerParams holds the inputs for creating a new worker.

type Manager

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

func NewManager

func NewManager(
	workerBaseDir string,
	bc config.BeeConfig,
	ws *store.WorkerStore,
	es *store.ExecutionStore,
	engines map[string]ai.EngineAdapter,
	engineCfg *enginecfg.Store,
	envService *env.Service,
) *Manager

func (*Manager) CancelExecution

func (m *Manager) CancelExecution(_ context.Context, executionID string) error

CancelExecution implements task.ExecutionManager. It stops the active worker process for the given executionID.

func (*Manager) CreateWorker

func (m *Manager) CreateWorker(p CreateWorkerParams) (model.Worker, error)

func (*Manager) DeleteWorker

func (m *Manager) DeleteWorker(id string, deleteWorkDir bool) error

func (*Manager) EnabledEngines added in v0.0.26

func (m *Manager) EnabledEngines() []string

func (*Manager) ExecuteWorker

func (m *Manager) ExecuteWorker(ctx context.Context, workerID, triggerInput, sessionID string, resume bool) (model.WorkerExecution, error)

ExecuteWorker runs a worker. When resume is true, the AI engine will attempt to resume the session identified by sessionID; otherwise it starts a fresh session. sessionID must always be non-empty; callers are responsible for generating it.

func (*Manager) StopExecution

func (m *Manager) StopExecution(executionID string) error

func (*Manager) ValidateEngine added in v0.0.26

func (m *Manager) ValidateEngine(name string) error

An empty name is accepted (means "use server default").

type UpdateWorkerParams added in v0.0.30

type UpdateWorkerParams struct {
	Name             *string `json:"name"`
	Description      *string `json:"description"`
	Constraints      *string `json:"constraints"`
	PermissionScopes *string `json:"permission_scopes"`
	Engine           *string `json:"engine"`
}

UpdateWorkerParams holds the inputs for a partial worker update.

func (UpdateWorkerParams) ApplyTo added in v0.0.30

func (p UpdateWorkerParams) ApplyTo(w *model.Worker)

func (UpdateWorkerParams) HasChanges added in v0.0.30

func (p UpdateWorkerParams) HasChanges() bool

func (UpdateWorkerParams) Validate added in v0.0.30

func (p UpdateWorkerParams) Validate(m *Manager) error

Jump to

Keyboard shortcuts

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