background

package
v3.0.34 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOwner = errors.New("BACKGROUND_INVALID_OWNER")
	ErrInvalidEntry = errors.New("BACKGROUND_INVALID_ENTRY")
	ErrNotFound     = errors.New("BACKGROUND_NOT_FOUND")
	ErrClosed       = errors.New("BACKGROUND_MANAGER_CLOSED")
)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	WorkerID string
	Strategy Strategy
}

type Manager

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

func NewManager

func NewManager(runner Runner) (*Manager, error)

func (*Manager) Get

func (manager *Manager) Get(owner Owner, workerID string) (Session, error)

func (*Manager) Recover

func (manager *Manager) Recover(ctx context.Context, owner Owner, entries []Entry) error

func (*Manager) Shutdown

func (manager *Manager) Shutdown(ctx context.Context) error

func (*Manager) Start

func (manager *Manager) Start(ctx context.Context, owner Owner, entry Entry) (Session, error)

func (*Manager) Stop

func (manager *Manager) Stop(ctx context.Context, owner Owner, workerID string) error

func (*Manager) StopOwner

func (manager *Manager) StopOwner(ctx context.Context, owner Owner) error

func (*Manager) StopPluginEnvironment

func (manager *Manager) StopPluginEnvironment(ctx context.Context, pluginInstanceID, environmentScope string) error

type Owner

type Owner struct {
	PluginInstanceID string
	UserScope        string
	EnvironmentScope string
}

type Runner

type Runner interface {
	Start(context.Context, Owner, string) (Session, error)
	Stop(context.Context, Session) error
}

type Session

type Session struct {
	Handle   string
	Owner    Owner
	WorkerID string
}

type Strategy

type Strategy string
const (
	RuntimeStart Strategy = "runtime_start"
	OnDemand     Strategy = "on_demand"
)

Jump to

Keyboard shortcuts

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