Files
vm/rpc/runtime/subprocess/stopper.go
zeekay 169bc81366 fix: resolve proto import paths and test compilation issues
- Fix dag package imports to use vm/proto/pb/dag instead of node/proto
- Fix api/health test to use atomic.Atomic from github.com/luxfi/atomic
- Fix components/message test to use crypto.RandomBytes
- Fix chains/manager to use correct EngineType constant
2026-01-11 20:58:38 -08:00

33 lines
544 B
Go

// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package subprocess
import (
"context"
"os/exec"
"sync"
"github.com/luxfi/log"
"github.com/luxfi/vm/rpc/runtime"
)
func NewStopper(logger log.Logger, cmd *exec.Cmd) runtime.Stopper {
return &stopper{
cmd: cmd,
logger: logger,
}
}
type stopper struct {
once sync.Once
cmd *exec.Cmd
logger log.Logger
}
func (s *stopper) Stop(ctx context.Context) {
s.once.Do(func() {
stop(ctx, s.logger, s.cmd)
})
}