Yggdrasil v4.1.5 Yggdrasil.Settings View Source
This module defines the available settings for Yggdrasil.
Use h Yggdrasil.Settings.<name of the environment variable>
to get more
information about every declaration in this file.
Link to this section Summary
Functions
Module registry table name
Module registry table name
Process registry
Process registry
Yggdrasil publisher options. This options are for :poolboy
. Defaults to
[size: 5, max_overflow: 10]
Yggdrasil publisher options. This options are for :poolboy
. Defaults to
[size: 5, max_overflow: 10]
Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2
Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2
Pub-sub name. By default is Yggdrasil.PubSub
Pub-sub name. By default is Yggdrasil.PubSub
Pub-sub options. By default are [pool_size: 1]
Pub-sub options. By default are [pool_size: 1]
Link to this section Functions
Module registry table name.
A call to Yggdrasil.Settings.yggdrasil_module_registry()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Yggdrasil.Settings.yggdrasil_module_registry(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The OS environment variable expected is
$YGGDRASIL_MODULE_REGISTRY
. If there is a namespace, for
example Namespace
, the OS environment variable would be
$NAMESPACE_YGGDRASIL_MODULE_REGISTRY
.
The expected application configuration is as follows:
config :yggdrasil,
module_registry: atom() # Defaults to :yggdrasil_registry
and with a namespace, for example Namespace
, the expected application
configuration would be:
config :yggdrasil, Namespace,
module_registry: atom() # Defaults to :yggdrasil_registry
For testing purposes, the value can be reloaded at runtime with the
function Yggdrasil.Settings.yggdrasil_module_registry(namespace, :reload)
where
namespace
can be nil
or an atom()
.
Module registry table name.
Same as Yggdrasil.Settings.yggdrasil_module_registry/0
but fails on error.
It can receive also a namespace when needed.
Process registry.
A call to Yggdrasil.Settings.yggdrasil_process_registry()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Yggdrasil.Settings.yggdrasil_process_registry(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The OS environment variable expected is
$YGGDRASIL_PROCESS_REGISTRY
. If there is a namespace, for
example Namespace
, the OS environment variable would be
$NAMESPACE_YGGDRASIL_PROCESS_REGISTRY
.
The expected application configuration is as follows:
config :yggdrasil,
process_registry: atom() # Defaults to ExReg
and with a namespace, for example Namespace
, the expected application
configuration would be:
config :yggdrasil, Namespace,
process_registry: atom() # Defaults to ExReg
For testing purposes, the value can be reloaded at runtime with the
function Yggdrasil.Settings.yggdrasil_process_registry(namespace, :reload)
where
namespace
can be nil
or an atom()
.
Process registry.
Same as Yggdrasil.Settings.yggdrasil_process_registry/0
but fails on error.
It can receive also a namespace when needed.
Yggdrasil publisher options. This options are for :poolboy
. Defaults to
[size: 5, max_overflow: 10]
.
A call to Yggdrasil.Settings.yggdrasil_publisher_options()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Yggdrasil.Settings.yggdrasil_publisher_options(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The OS environment variable expected is
$YGGDRASIL_PUBLISHER_OPTIONS
. If there is a namespace, for
example Namespace
, the OS environment variable would be
$NAMESPACE_YGGDRASIL_PUBLISHER_OPTIONS
.
The expected application configuration is as follows:
config :yggdrasil,
publisher_options: () # Defaults to [size: 5, max_overflow: 10]
and with a namespace, for example Namespace
, the expected application
configuration would be:
config :yggdrasil, Namespace,
publisher_options: () # Defaults to [size: 5, max_overflow: 10]
For testing purposes, the value can be reloaded at runtime with the
function Yggdrasil.Settings.yggdrasil_publisher_options(namespace, :reload)
where
namespace
can be nil
or an atom()
.
Yggdrasil publisher options. This options are for :poolboy
. Defaults to
[size: 5, max_overflow: 10]
.
Same as Yggdrasil.Settings.yggdrasil_publisher_options/0
but fails on error.
It can receive also a namespace when needed.
Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2
.
A call to Yggdrasil.Settings.yggdrasil_pubsub_adapter()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Yggdrasil.Settings.yggdrasil_pubsub_adapter(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The OS environment variable expected is
$YGGDRASIL_PUBSUB_ADAPTER
. If there is a namespace, for
example Namespace
, the OS environment variable would be
$NAMESPACE_YGGDRASIL_PUBSUB_ADAPTER
.
The expected application configuration is as follows:
config :yggdrasil,
pubsub_adapter: atom() # Defaults to Phoenix.PubSub.PG2
and with a namespace, for example Namespace
, the expected application
configuration would be:
config :yggdrasil, Namespace,
pubsub_adapter: atom() # Defaults to Phoenix.PubSub.PG2
For testing purposes, the value can be reloaded at runtime with the
function Yggdrasil.Settings.yggdrasil_pubsub_adapter(namespace, :reload)
where
namespace
can be nil
or an atom()
.
Pub-sub adapter to use for channels. Default value is Phoenix.PubSub.PG2
.
Same as Yggdrasil.Settings.yggdrasil_pubsub_adapter/0
but fails on error.
It can receive also a namespace when needed.
Pub-sub name. By default is Yggdrasil.PubSub
.
A call to Yggdrasil.Settings.yggdrasil_pubsub_name()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Yggdrasil.Settings.yggdrasil_pubsub_name(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The OS environment variable expected is
$YGGDRASIL_PUBSUB_NAME
. If there is a namespace, for
example Namespace
, the OS environment variable would be
$NAMESPACE_YGGDRASIL_PUBSUB_NAME
.
The expected application configuration is as follows:
config :yggdrasil,
pubsub_name: atom() # Defaults to Yggdrasil.PubSub
and with a namespace, for example Namespace
, the expected application
configuration would be:
config :yggdrasil, Namespace,
pubsub_name: atom() # Defaults to Yggdrasil.PubSub
For testing purposes, the value can be reloaded at runtime with the
function Yggdrasil.Settings.yggdrasil_pubsub_name(namespace, :reload)
where
namespace
can be nil
or an atom()
.
Pub-sub name. By default is Yggdrasil.PubSub
.
Same as Yggdrasil.Settings.yggdrasil_pubsub_name/0
but fails on error.
It can receive also a namespace when needed.
Pub-sub options. By default are [pool_size: 1]
.
A call to Yggdrasil.Settings.yggdrasil_pubsub_options()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Yggdrasil.Settings.yggdrasil_pubsub_options(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The OS environment variable expected is
$YGGDRASIL_PUBSUB_OPTIONS
. If there is a namespace, for
example Namespace
, the OS environment variable would be
$NAMESPACE_YGGDRASIL_PUBSUB_OPTIONS
.
The expected application configuration is as follows:
config :yggdrasil,
pubsub_options: () # Defaults to [pool_size: 1]
and with a namespace, for example Namespace
, the expected application
configuration would be:
config :yggdrasil, Namespace,
pubsub_options: () # Defaults to [pool_size: 1]
For testing purposes, the value can be reloaded at runtime with the
function Yggdrasil.Settings.yggdrasil_pubsub_options(namespace, :reload)
where
namespace
can be nil
or an atom()
.
Pub-sub options. By default are [pool_size: 1]
.
Same as Yggdrasil.Settings.yggdrasil_pubsub_options/0
but fails on error.
It can receive also a namespace when needed.