Spectre.Stack.Binding (Spectre v0.3.0)

Copy Markdown View Source

Binds an immutable Stack installation to one Agent definition.

install/2 has three distinct effects:

  • the Stack compiler produces immutable installation data;
  • Spectre.Stack.Runtime starts caller-owned resources;
  • this module activates package-declared Agent extensions when an Agent selects the Stack with use Spectre.Agent, stack: MyStack.

Packages opt into the last phase through the :agent_extensions field in their Spectre.Stack.Package manifest. Core owns registration and the single Agent compile pass; a package never needs a second @before_compile hook.

Summary

Functions

Fetches immutable package configuration through an Agent's selected Stack.

Fetches an installation bound to an Agent by local installation or package ID.

Returns the immutable package references bound into an Agent definition.

Functions

config(agent, id)

@spec config(module(), term()) :: {:ok, map() | keyword()} | {:error, term()}

Fetches immutable package configuration through an Agent's selected Stack.

installation(agent, id)

@spec installation(module(), term()) ::
  {:ok, Spectre.Stack.Installation.t()} | {:error, term()}

Fetches an installation bound to an Agent by local installation or package ID.

refs(agent)

@spec refs(module()) :: {:ok, [Spectre.Stack.Ref.t()]} | {:error, term()}

Returns the immutable package references bound into an Agent definition.