activator

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxPoolSize is the maximum number of sandboxes allowed in a pool
	// This prevents runaway growth even if there are bugs in scaling logic
	MaxPoolSize = 20
)

Variables

View Source
var ErrPoolTimeout = fmt.Errorf("timeout waiting for sandbox from pool")
View Source
var ErrSandboxDiedEarly = fmt.Errorf("sandbox died while booting")

Functions

This section is empty.

Types

type AppActivator

type AppActivator interface {
	AcquireLease(ctx context.Context, ver *core_v1alpha.AppVersion, service string) (*Lease, error)
	ReleaseLease(ctx context.Context, lease *Lease) error
	RenewLease(ctx context.Context, lease *Lease) (*Lease, error)

	// Invalidations returns a channel that receives notifications when
	// sandboxes become non-RUNNING. Consumers should invalidate any cached
	// leases referencing the invalidated sandbox.
	Invalidations() <-chan SandboxInvalidation
}

type Lease

type Lease struct {
	Size int
	URL  string
	// contains filtered or unexported fields
}

func NewTestLease added in v0.6.0

func NewTestLease(sb *compute_v1alpha.Sandbox, size int, url string) *Lease

NewTestLease creates a Lease with the given sandbox, size, and URL. This is only intended for use in tests outside the activator package.

func (*Lease) Pool

func (l *Lease) Pool() string

func (*Lease) Sandbox

func (l *Lease) Sandbox() *compute_v1alpha.Sandbox

func (*Lease) SandboxEntity

func (l *Lease) SandboxEntity() *entity.Entity

func (*Lease) Version

func (l *Lease) Version() *core_v1alpha.AppVersion

type SandboxInvalidation added in v0.6.0

type SandboxInvalidation struct {
	SandboxID entity.Id
}

SandboxInvalidation is sent when a sandbox transitions away from RUNNING, signaling that any cached leases pointing to it should be invalidated.

Jump to

Keyboard shortcuts

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