inproc

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 6 Imported by: 0

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

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

func (c *Client) Close() error

Close implements control.Client. Subsequent Send returns ErrClientClosed; Subscribe channels close.

func (*Client) ID

func (c *Client) ID() ids.ClientID

ID implements control.Client.

func (*Client) IdentityClass

func (c *Client) IdentityClass() control.IdentityClass

IdentityClass implements control.Client.

func (*Client) IsClosed

func (c *Client) IsClosed() bool

IsClosed reports whether Close has been called.

func (*Client) Send

func (c *Client) Send(ctx context.Context, cmd control.Command) error

Send implements control.Client by routing through the dispatcher.

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context) <-chan control.EventEnvelope

Subscribe implements control.Client. Wraps the bus subscription so the channel closes when the Client is Closed.

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.

Jump to

Keyboard shortcuts

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