cancellationwatcher

package
v0.198.21 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: BSD-2-Clause Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 execution and closes the returned channel.
	// The goroutine exits when ctx is cancelled or cancellation is detected.
	//
	// executionID 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, executionID 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