package vm // Executor is the common interface for bundle execution backends // Implemented by NixPool (dev mode) and FirecrackerPool (prod mode) type Executor interface { // Execute runs a bundle and returns the result Execute(req ExecuteRequest, mimeType string) (*ExecuteResponse, error) // Stats returns pool statistics Stats() PoolStats // Warm pre-warms the executor (downloads nix packages or boots VMs) Warm(count int) error // Drain gracefully shuts down all running executions Drain() // Shutdown stops the executor Shutdown() } // Ensure implementations satisfy the interface var _ Executor = (*NixPool)(nil) var _ Executor = (*ContainerPool)(nil) var _ Executor = (*FirecrackerPool)(nil) // FirecrackerPool is the production executor using Firecracker VMs // TODO: Implement this type FirecrackerPool struct { pool *Pool } func NewFirecrackerPool(cfg *Config) (*FirecrackerPool, error) { // For now, wrap the existing Pool // This will be expanded with real Firecracker integration return &FirecrackerPool{}, nil } func (f *FirecrackerPool) Execute(req ExecuteRequest, mimeType string) (*ExecuteResponse, error) { return &ExecuteResponse{ Success: false, Error: "Firecracker execution not yet implemented", }, nil } func (f *FirecrackerPool) Stats() PoolStats { return PoolStats{ Runtimes: make(map[string]RuntimeStats), Total: TotalStats{Max: 0}, } } func (f *FirecrackerPool) Warm(count int) error { return nil } func (f *FirecrackerPool) Drain() {} func (f *FirecrackerPool) Shutdown() {}