-type options() :: #{tag := tag(),
actions :=
#{classy:site() => actions()},
run_level =>
classy:predefined_run_level(),
post_vote => classy_lib:mfargs(),
strategy => strategy(),
on_fail => classy_lib:mfargs()}.
Common vote options.
tagAn arbitrary tag identifying the commit action. Ongoing commit actions can be efficiently filtered by the tag.
actionsA map from site ID to per-site commit actions (see classy_vote:actions/0).
Each site in the map becomes a vote participant.
Participants’ actions may be non-uniform.
post_voteCallback that is executed on the coordinator after the decision is made. Classy prepends two arguments to the user-specified argument list:
The return value is ignored.
Note: it’s NOT guaranteed that all commit actions on the participants are finished
by the time when post_vote is called.
This callback can be retried on node restart.
strategyon_failExecuted on both coordinator and participant if commit / rollback / post_commit actions fail.
This callback may be used to signal failures to the business logic.
Classy prepends an argument of type classy_vote:fail_info/0 to the user-specified argument list.
run_levelMinimum run level required to run vote actions.
Defaults to cluster.
Classy makes sure that actions don’t run while the run level is not appropriate.