Documentation
¶
Index ¶
- func Acknowledge(ctx context.Context)
- func Bound(ctx context.Context) bool
- func Complete(ctx context.Context)
- func Resumed(ctx context.Context)
- func Suspended(ctx context.Context)
- func WithAcknowledgment(ctx context.Context, fn func()) context.Context
- func WithRunPhase(ctx context.Context, phase RunPhase) context.Context
- func WithSuspensionAcknowledgment(ctx context.Context, fn func()) context.Context
- type LifecycleError
- type RunPhase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Acknowledge ¶
Acknowledge reports that a handler has entered the runtime boundary. Calls after the first are no-ops.
func Bound ¶
Bound reports whether ctx carries an acknowledgment: a request without one has nothing to hold back.
func Complete ¶
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 WithAcknowledgment ¶
WithAcknowledgment binds a one-shot handler-invocation acknowledgment to ctx. The handler's first suspension or its completion releases it.
func WithRunPhase ¶
WithRunPhase binds phase to ctx; the transport serving a request with ctx reports to it.
func WithSuspensionAcknowledgment ¶
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.