CouncilEx.Runner.RoundExec (CouncilEx v0.1.0)

Copy Markdown View Source

Pure round-execution logic shared by the synchronous CouncilEx.Runner and the internal M2b run-server (CouncilEx.RunServer).

Summary

Types

retry_policy()

@type retry_policy() :: {pos_integer(), non_neg_integer()}

Functions

resolve_retry(member_opts, round_opts, run_opts)

@spec resolve_retry(keyword(), keyword(), keyword()) :: retry_policy()

Resolve the retry policy for a member call.

Layers, highest priority first:

  1. per-member opt (retry: {max, base_ms})
  2. runtime opt to CouncilEx.run/2
  3. application config :default_retry
  4. built-in {2, 1000}

round_name(round_mod)

@spec round_name(module()) :: atom()

run_round(round_mod, round_opts, round_name, idx, members, ctx, run_opts)

@spec run_round(
  module(),
  keyword(),
  atom(),
  non_neg_integer(),
  [{atom(), module(), keyword()}],
  CouncilEx.Context.t(),
  map()
) :: CouncilEx.RoundResult.t()