process

package
v0.0.0-...-4afd048 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 19 Imported by: 0

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 New

func New(logger *slog.Logger) *Backend

New returns a Process Backend ready to manage capability runtime workers.

func (*Backend) BackendName

func (r *Backend) BackendName() string

RuntimeName returns "process", matching RuntimeKindProcess.

func (*Backend) Close

func (r *Backend) Close(ctx context.Context) error

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

Start launches an capability runtime instance backed by a pool of long-lived worker processes. The pool is created lazily on the first request.

Jump to

Keyboard shortcuts

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