pool

package
v0.81.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 = compiler.Directive{
	Name:        "pool",
	Example:     `@pool fast [cheap, mid] { strategy: "round_robin" }`,
	Handler:     handleDirective,
	OpaqueBlock: true,
}

Directive parses `@pool NAME [members] { options }` and appends a Declaration to meta["pools"].

Functions

func Bundle

func Bundle(_ map[string]string) compiler.Bundle

func PoolsFromMeta

func PoolsFromMeta(meta map[string]any) map[string][]string

PoolsFromMeta reduces the declarations to a canonical name → members map used by the dispatch action.

Types

type Declaration

type Declaration struct {
	Name     string
	Members  []compiler.CapabilityRef
	Strategy string
	Options  map[string]string
	Position compiler.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.

Jump to

Keyboard shortcuts

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