Documentation
¶
Overview ¶
Package ipc contains the public cross-process inference contract. Worker supervision and wire framing remain internal; applications depend only on this context-aware interface and can supply in-process, subprocess, or remote implementations without coupling models to a transport.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInferenceExecutorClosed = errors.New("ipc: inference executor is closed")
Functions ¶
func IsInferenceExecutor ¶
IsInferenceExecutor reports whether value is a non-nil executor without invoking it. It safely handles typed nil interfaces.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher provides a deterministic, allocation-light method registry for local and subprocess executors. Registration is intended for startup; Seal turns the registry immutable and enables lock-free dispatch reads.
func NewDispatcher ¶
func NewDispatcher() *Dispatcher
func (*Dispatcher) DoInference ¶
func (*Dispatcher) Register ¶
func (d *Dispatcher) Register(method string, handler InferenceExecutorFunc) error
func (*Dispatcher) Seal ¶
func (d *Dispatcher) Seal()
type InferenceExecutor ¶
InferenceExecutor is the Go equivalent of agents-js doInference(method, data). Context cancellation is mandatory in Go so a dead child process or native model can never pin job shutdown indefinitely.
type InferenceExecutorFunc ¶
InferenceExecutorFunc adapts a function to InferenceExecutor.
func (InferenceExecutorFunc) DoInference ¶
type Request ¶
type Request struct {
ID string `json:"id,omitempty"`
Method string `json:"method"`
Data any `json:"data,omitempty"`
}
Request is a transport-neutral inference request. ID is optional for direct executors and required by multiplexed transports.
type Response ¶
type Response struct {
ID string `json:"id,omitempty"`
Data any `json:"data,omitempty"`
Err error `json:"-"`
}
Response carries either Data or Err. Transport implementations should map remote error codes to a typed error before returning from DoInference.
type UnknownMethodError ¶
type UnknownMethodError struct{ Method string }
func (*UnknownMethodError) Error ¶
func (e *UnknownMethodError) Error() string