invocation

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Acknowledge

func Acknowledge(ctx context.Context)

Acknowledge reports that a handler has entered the runtime boundary. Calls after the first are no-ops.

func Bound

func Bound(ctx context.Context) bool

Bound reports whether ctx carries an acknowledgment: a request without one has nothing to hold back.

func Complete

func Complete(ctx context.Context)

Complete reports that a transport observed the handler finish. It releases an acknowledgment bound by WithAcknowledgment and leaves one bound by WithSuspensionAcknowledgment to its binder.

func Resumed

func Resumed(ctx context.Context)

Resumed reports to ctx's RunPhase, if any, that its handler runs again.

func Suspended

func Suspended(ctx context.Context)

Suspended reports to ctx's RunPhase, if any, that its handler awaits.

func WithAcknowledgment

func WithAcknowledgment(ctx context.Context, fn func()) context.Context

WithAcknowledgment binds a one-shot handler-invocation acknowledgment to ctx. The handler's first suspension or its completion releases it.

func WithRunPhase

func WithRunPhase(ctx context.Context, phase RunPhase) context.Context

WithRunPhase binds phase to ctx; the transport serving a request with ctx reports to it.

func WithSuspensionAcknowledgment

func WithSuspensionAcknowledgment(ctx context.Context, fn func()) context.Context

WithSuspensionAcknowledgment binds a one-shot acknowledgment that only a suspension releases. A transport's completion report does not release it: the binder acknowledges a completed handler itself once the handler's result is published, so an awaiting continuation of a handler that never suspended runs before the caller admits later input.

Types

type LifecycleError

type LifecycleError struct {
	Err error
}

LifecycleError preserves an invocation failure whose diagnostic belongs to the subprocess lifecycle handler. Callers still receive an error; the runner must not emit a second notification for the same failed connection.

func (*LifecycleError) Error

func (e *LifecycleError) Error() string

func (*LifecycleError) Unwrap

func (e *LifecycleError) Unwrap() error

type RunPhase

type RunPhase interface {
	// Resumed reports that the handler runs again: it made a call that Pi runs inside its synchronous part.
	Resumed()
	// Suspended reports that the handler awaits.
	Suspended()
}

RunPhase follows whether a request's handler runs its synchronous part or is suspended, as the request's transport sees it. RPC mode holds the start of a run that a command sends until the command next suspends or answers (rpc-mode.ts, cli rpcAdmission.extensionRunStage); the transport reports each change to the phase bound to the command's context.

Jump to

Keyboard shortcuts

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