Documentation
¶
Overview ¶
Package worker implements the private same-executable parent/child transport.
Protocol types, frame codecs, and connection state machines are not public API. They exist only between a host process and a worker re-exec of the same binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProtocol = errors.New("worker protocol violation")
ErrProtocol lets the authoritative root dispatcher report an impossible child ID or re-bind mismatch.
Functions ¶
Types ¶
type Dispatch ¶
Dispatch invokes one authoritative parent capability operation.
remainingIntermediateBytes is the unused native-result value-body budget for this execution. handleNative passes min(MaxValueBytes, remainingIntermediate); the dispatcher uses that as the ConvertOutput node and materialization limit. Exact encoded-byte debit stays in writeNativeResult.
type Limits ¶
type Limits struct {
// MaxSourceBytes bounds submitted source length.
MaxSourceBytes int
// MaxExecutionSteps bounds interpreter work.
MaxExecutionSteps uint64
// MaxExecutionTime bounds elapsed execution time including queue wait.
MaxExecutionTime time.Duration
// MaxNativeCalls bounds attempted native invocations.
MaxNativeCalls uint64
// MaxValueDepth bounds recursive converted-value nesting.
MaxValueDepth int
// MaxValueBytes bounds type-preserving encoded value size.
MaxValueBytes int
// MaxIntermediateValueBytes bounds cumulative successful native-result
// value-body bytes for one Execute call. It is independent of MaxValueBytes
// and is never projected to the child.
MaxIntermediateValueBytes int
// MaxConcurrentExecutions bounds live worker children.
MaxConcurrentExecutions int
}
Limits is the parent-owned immutable worker budget set.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner owns immutable manifest, budgets, caps, dispatch, and live-child permits.
func NewRunner ¶
func NewRunner(bindings []execution.CapabilityBinding, limits Limits, dispatch Dispatch) (*Runner, error)
NewRunner constructs an immutable runner after validating budgets, manifest, and frame caps.