Documentation
¶
Overview ¶
Package warmpool maintains a pool of pre-started Docker containers for a single configured image, eliminating docker pull+create latency on the hot path.
The pool is optional. When WARM_POOL_SIZE is 0 or WARM_POOL_IMAGE is unset the pool is disabled and session creation uses the standard on-demand path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
ContainerID string
WorkspacePath string // host path; already bound-mounted inside the container
}
Entry is a pre-warmed container ready for takeover by a new session.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool maintains a buffered channel of warm containers and refills it in the background. All methods are goroutine-safe.
func New ¶
New creates a warm pool. Call Start to begin filling it. The pool uses the docker client's seccomp profile and performs cosign verification before creating each container.
func (*Pool) Acquire ¶
Acquire pops a warm container (non-blocking). Returns (entry, true) when one is available, or (Entry{}, false) when the pool is empty (caller falls back to on-demand creation).