4.18.5 options()

-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.

tag

An arbitrary tag identifying the commit action. Ongoing commit actions can be efficiently filtered by the tag.

actions

A 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_vote

Callback that is executed on the coordinator after the decision is made. Classy prepends two arguments to the user-specified argument list:

  1. A boolean indicating the decision
  2. Vote ID

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.

strategy

See classy_vote:strategy/0.

on_fail

Executed 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_level

Minimum 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.

JavaScript license information