Configuration for the Arrea engine.
Configuration priority
Arrea as a library (lowest to highest priority)
@default— Baseline values compiled in this module. Always present.config :arrea, :engine, [...]in the consumer project'sconfig.exs— overrides the defaults at compile time through OTP's Application env.Arrea.Config.set/2at runtime — persists in the current VM session viaApplication.put_env. Overrides static config.- Options passed directly to the functions (
execute/2,run/2, etc.) — highest priority. Callers should check opts before falling back toConfig.get/2.
Note on "Arrea's own config"
As an Elixir/OTP library, Arrea cannot have its own config files with
higher priority than the consumer project — the consumer project always
wins in the Application env hierarchy. The @default in this module
is the only "own" Arrea configuration, and it acts as a baseline.
Arrea as a CLI (lowest to highest priority)
@default— Baseline values of the binary.- Application env (if Arrea is used in a mix context).
arrea config set KEY VALUE— Session config. Persists for the lifetime of the binary process. Uses the same mechanism asConfig.set/2.- CLI args — Highest priority. Applied to the current invocation only.
Example in config.exs
Acepta tanto keyword list como mapa:
# Keyword list (estilo estándar Elixir)
config :arrea, :engine,
max_workers: 200,
circuit_breaker_threshold: 10
# Mapa equivalente
config :arrea, :engine, %{max_workers: 200, circuit_breaker_threshold: 10}Runtime usage
Arrea.Config.get(:max_workers) # => 100 (default)
Arrea.Config.set(:max_workers, 50) # persiste en la sesión actual
Arrea.Config.get(:max_workers) # => 50
Summary
Functions
Returns all engine configuration values, merging the defaults with the Application env values.
Returns a configuration value from the engine.
Sets a configuration value in memory for the current session.
Functions
@spec all() :: map()
Returns all engine configuration values, merging the defaults with the Application env values.
The result reflects the current effective configuration, including
config.exs overrides and any changes applied with Config.set/2.
Returns a configuration value from the engine.
Resolution (lowest to highest priority):
@defaultof the module- Application env (consumer's
config.exsorConfig.set/2at runtime)
Function opts take priority over this value and should be checked
first in the caller before falling back to Config.get/2.
Examples
iex> Arrea.Config.get(:max_workers)
100
iex> Arrea.Config.get(:nonexistent_key, :fallback)
:fallback
Sets a configuration value in memory for the current session.
Los cambios persisten mientras viva el proceso de la VM. Para cambios
permanentes, usar config.exs del proyecto consumidor.
En el contexto de CLI, equivale a arrea config set — los cambios
se mantienen mientras el proceso del binario esté activo, pero no
sobreviven a reinicios.
Examples
iex> Arrea.Config.set(:max_workers, 50)
:ok
iex> Arrea.Config.get(:max_workers)
50