Documentation
¶
Overview ¶
Package hydrated realizes bitwire decision 0019, the hydrated wire protocol's first edition, over bitwire's public hydrated declarations and its shared pure codec. The codec owns the grammar, validation and bounds; this package owns export ids and staging, reference recognition, liveness and endpoints.
A Scope is one participant's hydration state for one incarnation. Its dispatcher owns the participant's addressed receive slot and hands the Scope every value addressed to the participant's own path, with the received context the composition establishes. Domain code sees only Values, Wires and Endpoints.
Index ¶
- Variables
- func Items(v wire.HydratedValue) ([]wire.HydratedValue, bool)
- func NewTuple(items ...wire.HydratedValue) (wire.HydratedValue, error)
- type Endpoint
- func (e *Endpoint) Close() error
- func (e *Endpoint) Closed() <-chan struct{}
- func (e *Endpoint) Receive(handler func(wire.HydratedValue, wire.ReceivedContext)) (detach func(), err error)
- func (e *Endpoint) Send(v wire.HydratedValue) error
- func (e *Endpoint) Termination() wire.Termination
- func (e *Endpoint) Wire() wire.HydratedWire
- type Limits
- type Local
- type Namespace
- type Reference
- type Refusal
- type Scope
Constants ¶
This section is empty.
Variables ¶
var DefaultLimits = Limits{Exports: 64, Nodes: 4096, Depth: 64, Bytes: 1 << 20}
DefaultLimits are finite defaults; a composition configures its own.
Functions ¶
func Items ¶
func Items(v wire.HydratedValue) ([]wire.HydratedValue, bool)
Items observes any tuple's immutable children; it confers no authority.
func NewTuple ¶
func NewTuple(items ...wire.HydratedValue) (wire.HydratedValue, error)
NewTuple captures immediate children under the runtime's sending-face policy.
Types ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint is a local HydratedEndpoint: one receiver, ordered non-inline dispatch, a bounded queue and an owner lifetime. Its sending face is what a value carries; closing it ends its export in every scope (D7).
func NewEndpoint ¶
NewEndpoint creates an endpoint whose queue admits at most limit values. A bound below one is a programming error.
func (*Endpoint) Closed ¶
func (e *Endpoint) Closed() <-chan struct{}
Closed is closed when the endpoint closes.
func (*Endpoint) Receive ¶
func (e *Endpoint) Receive(handler func(wire.HydratedValue, wire.ReceivedContext)) (detach func(), err error)
Receive attaches the one receiver. Values are dispatched in admission order, never inline with the admitting send.
func (*Endpoint) Send ¶
func (e *Endpoint) Send(v wire.HydratedValue) error
Send admits a value locally, as its sending face does.
func (*Endpoint) Termination ¶
func (e *Endpoint) Termination() wire.Termination
Termination reports how the endpoint ended, as bitwire's Endpoint contract does: "failed" with the receiver's failure, or "closed". It is the zero value while the endpoint is open. The first termination is final: it is set before Closed is closed, and a receiver failing after Close leaves it "closed".
func (*Endpoint) Wire ¶
func (e *Endpoint) Wire() wire.HydratedWire
wire.HydratedWire is the endpoint's sending face.
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace identifies one set of participants addressed by absolute paths. Proxies remember theirs, so recognition is runtime-wide within it (D6).
type Reference ¶
Reference is the ground form of a live wire.HydratedWire (D2, D3).
func ReadReference ¶
ReadReference reads a reference payload.
type Refusal ¶
type Refusal string
Refusal names a refusal. At the owner it is a host diagnostic; at the sender it refuses the send before admission. It is never an outcome (D8).
const ( MalformedFrame Refusal = "malformed-frame" StaleScope Refusal = "stale-scope" UnknownExport Refusal = "unknown-export" Limit Refusal = "limit" TargetRefused Refusal = "target-refused" Unexportable Refusal = "unexportable" ForeignNamespace Refusal = "foreign-namespace" ScopeEnded Refusal = "scope-ended" )
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope is one participant's hydration state for one incarnation (Terms).
func NewScope ¶
func NewScope(ns *Namespace, path wire.Path, sender wire.AddressedWire, limits Limits) (*Scope, error)
NewScope creates a scope at path in ns with a fresh random token. sender carries frames to owner paths; the composition supplies its routing.
func (*Scope) Close ¶
func (s *Scope) Close()
Close ends the scope: its exports end and its references go stale. It closes no domain endpoint.
func (*Scope) Connect ¶
func (s *Scope) Connect(r Reference) wire.HydratedWire
Connect returns a proxy for a reference, for composition bootstrap.
func (*Scope) Deliver ¶
Deliver decides one value addressed to this participant's own path (D4). The returned refusal is a host diagnostic; nothing is sent back.