Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PromptLoader ¶
PromptLoader is the minimal subset of processor.PromptManager that this package needs. Defined locally to avoid an import cycle (pkg/processor imports cancellationwatcher).
type Watcher ¶
type Watcher interface {
// Watch starts a goroutine that watches promptPath for status==cancelled.
// When detected, it stops/removes the container and closes the returned channel.
// The goroutine exits when ctx is cancelled or cancellation is detected.
//
// containerName is passed as a string to avoid an import cycle with pkg/processor.
// PromptLoader is a minimal local interface for the same reason.
Watch(ctx context.Context, promptPath string, containerName string) <-chan struct{}
}
Watcher monitors a prompt file for cancellation and stops its container when triggered.
func NewWatcher ¶
func NewWatcher(exec executor.Executor, promptLoader PromptLoader) Watcher
NewWatcher creates a Watcher that uses fsnotify to detect cancellation.
Click to show internal directories.
Click to hide internal directories.