View Source partisan_config (partisan v5.0.0-beta.14)
This module handles the validation, access and modification of Partisan configuration options. Some options will only take effect after a restart of the Partisan application, while other will take effect while the application is still running.
As per Erlang convention the options are given using the sys.config
file under the partisan
application section.
options
Options
The following is the list of all the options you can read using get/ 1
and get/2
, and modify using the sys.config
file and set/ 2
.arwl
- TBD
binary_padding
- TBD
broadcast
- TBD
broadcast_mods
- TBD
causal_labels
- TBD
channels
- Defines the channels to be used by Partisan. The option takes either a channels map where keys are channel names (
channel()
) and values are channel options (channel_opts()
), or a list of values where each value can be any of the following types:- a channel name (
channel()
) e.g. the atomfoo
- a channel with options:
{channel(), channel_opts()}
- a monotonic channel using the tuple
{monotonic, Name :: channel()}
e.g.{monotonic, bar}
. This is a legacy representation, the same can be achieved with{bar, #{monotonic => true}}
The list can habe a mix of types and during startup they are all coerced to channels map. Coercion works by defaulting
parallelism
to the value of the global optionparallelism
which itself defaults to1
, andmonotonic
tofalse
.Finally the list is transformed to a map where keys are channel names and values are channel map representation.
Example:
Given the following option value:
The coerced representation will be the following map (which is a valid input and the final representation of this option after Partisan starts).[ foo, {monotonic, bar}, {bar, #{parallelism => 4}} ]
#{ foo => #{monotonic => false, parallelism => 1}, bar => #{monotonic => true, parallelism => 1}, baz => #{monotonic => false, parallelism => 4}, }
- a channel name (
connect_disterl
- Whether to use distributed erlang in addition to Partisan channels. This is used for testing and only works for
partisan_full_membership_strategy
(Seemembership_strategy
) connection_jitter
- TBD
default_channel
- The name of the default channel. This should be the name of one of the channels defined in
channels
. If not defined, anundefined
channel will be created as the default channel. The default channel is used when a specific channel hasn't been defined for messaging operations. disable_fast_forward
- TBD
disable_fast_receive
- TBD
distance_enabled
- TBD
egress_delay
- TBD
exchange_selection
- TBD
exchange_tick_period
- TBD
fanout
- The number of nodes that are contacted at each gossip interval. DEPRECATED?
gossip
- If
true
gossip is used to disseminate membership state. ingress_delay
- TBD
lazy_tick_period
- TBD
max_active_size
- TBD
max_passive_size
- TBD
membership_strategy
- TBD
membership_strategy_tracing
- TBD
min_active_size
- TBD
name
- TBD
orchestration_strategy
- TBD
parallelism
- TBD
partisan_peer_service_manager
- TBD
passive_view_shuffle_period
- TBD
peer_host
- TBD
peer_ip
- TBD
peer_port
- TBD
periodic_enabled
- TBD
periodic_interval
- TBD
pid_encoding
- TBD
prwl
- TBD
random_promotion
- TBD
random_seed
- TBD
ref_encoding
- TBD
register_pid_for_encoding
- TBD
remote_ref_as_uri
If
true
partisan remote references (see modulepartisan_remote_ref
) will be encoded as a URI binary. Otherwise it will be encoded as a tuple. The default isfalse
.1> partisan_config:set(remote_ref_as_uri, true). ok 2> partisan_remote_ref:from_term(self()). <<"partisan:pid:nonode@nohost:0.1062.0">> 3> partisan_config:set(remote_ref_as_uri, false). 4> partisan_remote_ref:from_term(self()). {partisan_remote_reference, nonode@nohost, {partisan_process_reference,"<0.1062.0>"}}
remote_ref_uri_padding
- If
true
and the URI encoding of a remote reference results in a binary smaller than 65 bytes, the URI will be padded. The default isfalse
. %%1> partisan_config:set(remote_ref_binary_padding, false). 1> partisan_remote_ref:from_term(self()). <<"partisan:pid:nonode@nohost:0.1062.0">> 2> partisan_config:set(remote_ref_binary_padding, true). ok 3> partisan_remote_ref:from_term(self()). <<"partisan:pid:nonode@nohost:0.1062.0:"...>>
replaying
- TBD
reservations
- TBD
shrinking
- TBD
tag
- TBD
tls
- TBD
tls_client_options
- TBD
tls_server_options
- TBD
tracing
- TBD
xbot_interval
- TBD
Link to this section Summary
Functions
Initialises the configuration from the application environment.
Link to this section Functions
-spec channel_opts(Name :: partisan:channel()) -> partisan:channel_opts().
-spec channels() -> #{partisan:channel() => partisan:channel_opts()}.
-spec default_channel() -> partisan:channel().
-spec default_channel_opts() -> partisan:channel_opts().
Key
in Opts
, if found. Otherwise, calls get/1
.
Key
in Opts
, if found. Otherwise, calls get/2
.
Initialises the configuration from the application environment.
You should never call this function. This is used by Partisan itself during startup.