interrupt

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 4 Imported by: ? modules, 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

Overview

Package interrupt provides workflow signal handling for pausing and resuming agent runs. It exposes a Controller that workflows can use to react to external pause/resume requests via workflow engine signals.

Index

Constants

View Source
const (
	// SignalPause is the workflow signal name used to pause a run.
	SignalPause = api.SignalPause
	// SignalResume is the workflow signal name used to resume a paused run.
	SignalResume = api.SignalResume

	// SignalProvideClarification delivers a ClarificationAnswer to a waiting run.
	SignalProvideClarification = api.SignalProvideClarification
	// SignalProvideToolResults delivers external tool results to a waiting run.
	SignalProvideToolResults = api.SignalProvideToolResults
	// SignalProvideConfirmation delivers a ConfirmationDecision to a waiting run.
	SignalProvideConfirmation = api.SignalProvideConfirmation
	// SignalProvideTypedInput delivers a TypedInputAnswer to a waiting run.
	SignalProvideTypedInput = api.SignalProvideTypedInput
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClarificationAnswer

type ClarificationAnswer = *api.ClarificationAnswer

ClarificationAnswer carries a typed answer for a paused clarification request.

type ConfirmationDecision

type ConfirmationDecision = *api.ConfirmationDecision

ConfirmationDecision carries a typed decision for a confirmation await.

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller drains runtime interrupt signals and exposes helpers the workflow loop can call to react to pause/resume and await requests.

func NewController

func NewController(wfCtx engine.WorkflowContext) *Controller

NewController builds a controller wired to the workflow context signals.

func (*Controller) PollPause

func (c *Controller) PollPause() (PauseRequest, bool)

PollPause attempts to dequeue a pause request without blocking.

func (*Controller) WaitProvideClarification

func (c *Controller) WaitProvideClarification(ctx context.Context, timeout time.Duration) (ClarificationAnswer, error)

WaitProvideClarification blocks until a clarification answer is delivered or the timeout elapses.

When timeout is <= 0, WaitProvideClarification blocks until an answer is delivered or ctx is done.

func (*Controller) WaitProvideConfirmation

func (c *Controller) WaitProvideConfirmation(ctx context.Context, timeout time.Duration) (ConfirmationDecision, error)

WaitProvideConfirmation blocks until a confirmation decision is delivered or the timeout elapses.

When timeout is <= 0, WaitProvideConfirmation blocks until a decision is delivered or ctx is done.

func (*Controller) WaitProvideToolResults

func (c *Controller) WaitProvideToolResults(ctx context.Context, timeout time.Duration) (ToolResultsSet, error)

WaitProvideToolResults blocks until external tool results are delivered or the timeout elapses.

When timeout is <= 0, WaitProvideToolResults blocks until results are delivered or ctx is done.

func (*Controller) WaitProvideTypedInput added in v1.2.2

func (c *Controller) WaitProvideTypedInput(ctx context.Context, timeout time.Duration) (TypedInputAnswer, error)

WaitProvideTypedInput blocks until a typed input answer is delivered or the timeout elapses.

When timeout is <= 0, WaitProvideTypedInput blocks until an answer is delivered or ctx is done.

func (*Controller) WaitResume

func (c *Controller) WaitResume(ctx context.Context, timeout time.Duration) (ResumeRequest, error)

WaitResume blocks until a resume request is delivered or the timeout elapses.

When timeout is <= 0, WaitResume blocks until a resume request is delivered or ctx is done.

type PauseRequest

type PauseRequest = *api.PauseRequest

PauseRequest carries metadata attached to a pause signal.

type ResumeRequest

type ResumeRequest = *api.ResumeRequest

ResumeRequest carries metadata attached to a resume signal.

type ToolResultsSet

type ToolResultsSet = *api.ToolResultsSet

ToolResultsSet carries results for an external tools await request.

type TypedInputAnswer added in v1.2.2

type TypedInputAnswer = *api.TypedInputAnswer

TypedInputAnswer carries schema-typed human input for a typed await request.

Jump to

Keyboard shortcuts

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