Documentation
¶
Overview ¶
Package process implements a Backend that hosts capability runtimes as OS child processes.
Two transports are supported, selected by the capability runtime's declared protocol:
- neuron/capability-runtime-v1 (canonical): the capability runtime process speaks gRPC over a Unix domain socket (see packages/capability runtime-sdks/golang). The runtime maintains a pool of long-lived worker processes, leasing requests to available workers. This provides warm runtimes, connection reuse, bounded concurrency, health checking, and graceful shutdown.
- neuron/capability-runtime-v1-json (legacy): the capability runtime speaks the one-shot stdin/stdout JSON protocol. Each execution spawns a fresh process, feeds it the JSON request on stdin, and reads the JSON response from stdout. This is the transport used by WASI capability runtimes and by process capability runtimes that predate the gRPC protocol.
The protocol negotiation happens during the Initialize handshake for gRPC workers: the runtime sends the protocol version and capability runtime identity, and the capability runtime responds with its supported version and capabilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend hosts capability runtime processes and manages their lifecycle. It implements capabilityrt.Backend and is registered with the backend registry for the "process" kind.
func (*Backend) BackendName ¶
RuntimeName returns "process", matching RuntimeKindProcess.
func (*Backend) Close ¶
Close shuts down every pool this backend manages, regardless of how many holders each pool has. This is the backend-level teardown performed when the runtime itself is shutting down; per-instance teardown goes through the BackendInstance Close contract and only releases a single holder.
func (*Backend) Start ¶
func (r *Backend) Start(ctx context.Context, spec capabilityrt.BackendSpec) (capabilityrt.BackendInstance, error)
Start launches an capability runtime instance backed by a pool of long-lived worker processes. The pool is created lazily on the first request.