Documentation
¶
Overview ¶
Package inproc is part of the GoFastr harness.
See docs/harness-architecture.md for the architecture this package implements.
Package inproc implements the in-process Client transport: Go channels carrying canonical event envelopes from the engine's bus directly to bundled clients (TUI, web) and Commands from those clients back into the multiplexer.
inproc is the only transport that runs entirely in one process — the others (rest, ws, mcpserver) are the same logical Client interface but with HTTP/WS/JSON-RPC framing.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) ID() ids.ClientID
- func (c *Client) IdentityClass() control.IdentityClass
- func (c *Client) IsClosed() bool
- func (c *Client) Send(ctx context.Context, cmd control.Command) error
- func (c *Client) Subscribe(ctx context.Context) <-chan control.EventEnvelope
- type Dispatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an in-process implementation of control.Client. It bridges the engine's per-session Bus to a Go channel the client surface reads from.
func New ¶
func New(id ids.ClientID, class control.IdentityClass, bus *engine.Bus, mux Dispatcher) *Client
New returns an inproc Client.
- id stable identity for permission and originator tracking
- class human (TUI/web) or agent (a Go-level harness driver)
- bus the engine.Bus for the session this client is attached to
- mux the Dispatcher (typically *multiplex.Mux)
func (*Client) Close ¶
Close implements control.Client. Subsequent Send returns ErrClientClosed; Subscribe channels close.
func (*Client) IdentityClass ¶
func (c *Client) IdentityClass() control.IdentityClass
IdentityClass implements control.Client.
type Dispatcher ¶
type Dispatcher interface {
Dispatch(ctx context.Context, c control.Client, cmd control.Command) error
}
Dispatcher is the subset of *multiplex.Mux that inproc needs. We use an interface so this package doesn't import multiplex (which would import engine, then back-imports). Multiplex satisfies this implicitly.