Documentation
¶
Overview ¶
Package pool provides the `@pool NAME [member1, member2] { strategy: "round_robin" }` directive. Each declaration is mounted as a `pool.<name>` action whose behavior depends on the strategy, and is also published through the execution context so `dispatch` can resolve it by name.
Typical use:
@pool workers [const, noop] { strategy: "failover" }
{ pool: "workers", payload: { value: "x" } } -> dispatch.run
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 []string
Strategy string
Options map[string]string
Position core.Position
}
Declaration is the parsed form of a single `@pool NAME [...] { ... }` directive.
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.