View Source Yggdrasil.Config.Icon (ICON 2.0 SDK v0.1.6)
This module defines configuration variables for ICON 2.0 WebSocket connection.
Link to this section Summary
Functions
WebSocket max retries for the backoff algorithm. Defaults to 3
.
WebSocket max retries for the backoff algorithm. Defaults to 3
.
Preloads all variables in a namespace
if supplied.
Puts the value
to Yggdrasil.Config.Icon.max_retries/0
. Optionally, receives
the namespace
.
Puts the value
to Yggdrasil.Config.Icon.slot_size/0
. Optionally, receives
the namespace
.
Reloads the value for Yggdrasil.Config.Icon.max_retries/0
. Optionally, receives
the namespace
for the variable.
Reloads the value for Yggdrasil.Config.Icon.slot_size/0
. Optionally, receives
the namespace
for the variable.
WebSocket slot size for the backoff algorithm. Defaults to 10
.
WebSocket slot size for the backoff algorithm. Defaults to 10
.
Creates a template for OS environment variables given a filename
.
Additionally, it can receive a list of options
Validates that all required variables are present.
Returns :ok
if they are, {:error, errors}
if they are not. errors
will be a list of all errors encountered while getting required variables.
Validates that all required variables are present.
Returns :ok
if they are, raises if they're not.
Link to this section Functions
Specs
max_retries(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
WebSocket max retries for the backoff algorithm. Defaults to 3
.
The backoff algorithm is exponential:
backoff_time = retries² * random(1, slot) * 1_000ms
where:
retries
is less or equal tomax_retries!/0
,- and
slot
is given byslot_size!/0
.
iex> Yggdrasil.Config.Icon.max_retries!()
3
Calling Yggdrasil.Config.Icon.max_retries()
will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_ICON_MAX_RETRIES"
- Type: :integer
- Default: 3
- Required: true
- Cached: true
Specs
max_retries!(Skogsra.Env.namespace()) :: integer() | no_return()
WebSocket max retries for the backoff algorithm. Defaults to 3
.
The backoff algorithm is exponential:
backoff_time = retries² * random(1, slot) * 1_000ms
where:
retries
is less or equal tomax_retries!/0
,- and
slot
is given byslot_size!/0
.
iex> Yggdrasil.Config.Icon.max_retries!()
3
Bang version of Yggdrasil.Config.Icon.max_retries/0
(fails on error). Optionally,
receives the namespace
for the variable.
Specs
preload(Skogsra.Env.namespace()) :: :ok
Preloads all variables in a namespace
if supplied.
Specs
put_max_retries(integer(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value
to Yggdrasil.Config.Icon.max_retries/0
. Optionally, receives
the namespace
.
Specs
put_slot_size(integer(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value
to Yggdrasil.Config.Icon.slot_size/0
. Optionally, receives
the namespace
.
Specs
reload_max_retries(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Reloads the value for Yggdrasil.Config.Icon.max_retries/0
. Optionally, receives
the namespace
for the variable.
Specs
reload_slot_size(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
Reloads the value for Yggdrasil.Config.Icon.slot_size/0
. Optionally, receives
the namespace
for the variable.
Specs
slot_size(Skogsra.Env.namespace()) :: {:ok, integer()} | {:error, binary()}
WebSocket slot size for the backoff algorithm. Defaults to 10
.
The backoff algorithm is exponential:
backoff_time = retries² * random(1, slot) * 1_000ms
where:
retries
is less or equal tomax_retries!/0
,- and
slot
is given byslot_size!/0
.
iex> Yggdrasil.Config.Icon.slot_size!()
10
Calling Yggdrasil.Config.Icon.slot_size()
will ensure the following:
- Binding order: [:system, :config]
- OS environment variable: "YGGDRASIL_ICON_SLOT_SIZE"
- Type: :integer
- Default: 10
- Required: true
- Cached: true
Specs
slot_size!(Skogsra.Env.namespace()) :: integer() | no_return()
WebSocket slot size for the backoff algorithm. Defaults to 10
.
The backoff algorithm is exponential:
backoff_time = retries² * random(1, slot) * 1_000ms
where:
retries
is less or equal tomax_retries!/0
,- and
slot
is given byslot_size!/0
.
iex> Yggdrasil.Config.Icon.slot_size!()
10
Bang version of Yggdrasil.Config.Icon.slot_size/0
(fails on error). Optionally,
receives the namespace
for the variable.
Specs
template( Path.t(), keyword() ) :: :ok | {:error, File.posix()}
Creates a template for OS environment variables given a filename
.
Additionally, it can receive a list of options:
type
: What kind of file it will generate (:elixir
,:unix
,:windows
).namespace
: Namespace for the variables.
Specs
validate(Skogsra.Env.namespace()) :: :ok | {:error, [binary()]}
Validates that all required variables are present.
Returns :ok
if they are, {:error, errors}
if they are not. errors
will be a list of all errors encountered while getting required variables.
It is possible to provide a namespace
as argument (defaults to nil
).
Specs
validate!(Skogsra.Env.namespace()) :: :ok | no_return()
Validates that all required variables are present.
Returns :ok
if they are, raises if they're not.
It is possible to provide a namespace
as argument (defaults to nil
).