CouncilEx.DynamicRound (CouncilEx v0.1.0)

Copy Markdown View Source

Data-only round spec for dynamic councils. Maps a string round type (e.g. "independent_analysis", "iterate") plus an opts map to one of the built-in round modules (or a user-registered round).

Built-in mappings come from an internal CouncilEx registry of round modules (private).

Inside Iterate, the :until option requires a 2-arity function. For dynamic councils, set :until_ref to a registered router-style name whose module exports until/2 (or omit to disable early stop and rely on :max_iterations).

Summary

Functions

Build from a plain map, keyword list, type-string, or type-atom.

Resolve %DynamicRound{} to {round_module, opts_keyword} suitable for the static Spec.rounds list.

JSON-friendly map representation.

Types

t()

@type t() :: %CouncilEx.DynamicRound{opts: map(), type: String.t()}

Functions

new(type)

@spec new(map() | keyword() | String.t() | atom()) :: t()

Build from a plain map, keyword list, type-string, or type-atom.

resolve(dynamic_round)

@spec resolve(t()) :: {module(), keyword()}

Resolve %DynamicRound{} to {round_module, opts_keyword} suitable for the static Spec.rounds list.

to_map(dynamic_round)

@spec to_map(t()) :: map()

JSON-friendly map representation.