cancellationwatcher

package
v0.135.13 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromptLoader

type PromptLoader interface {
	Load(ctx context.Context, path string) (*prompt.PromptFile, error)
}

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.

Jump to

Keyboard shortcuts

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