Documentation
¶
Overview ¶
Package pool provides the `@pool NAME [member1, member2] { strategy: "round_robin" }` directive. Each declaration is materialized as a callable `pool.<name>` action.
Typical use:
@pool workers [const, noop] { strategy: "failover" }
pool.workers @{ value: "x" }
Index ¶
Constants ¶
View Source
const ID = "pool"
Variables ¶
View Source
var Directive = core.Directive{
Name: "pool",
Example: `@pool fast [cheap, mid] { strategy: "round_robin" }`,
Handler: handleDirective,
}
Directive parses `@pool NAME [members] { options }` and appends a Declaration to meta["pools"].
Functions ¶
Types ¶
type Declaration ¶
type Declaration struct {
Name string
Members []core.CapabilityRef
Strategy string
Options map[string]string
Position core.Position
}
Declaration is the parsed form of a single `@pool NAME [...] { ... }` directive. Members are statically resolved capability references; canonical names are checked when the pool is materialized.
func DeclarationsFromMeta ¶
func DeclarationsFromMeta(meta map[string]any) []Declaration
DeclarationsFromMeta returns the list of @pool declarations in the order they appeared. Nil-safe.
Click to show internal directories.
Click to hide internal directories.