4.18.6 actions()

-type actions() :: #{prepare :=
                         classy_lib:mfargs(),
                     commit := [classy_lib:mfargs()],
                     rollback => [classy_lib:mfargs()]}.

Per-participant set of commit actions.

prepare

Callback that lets the participant decide whether to commit.

Classy prepends two additional values to the user-specified argument list:

  1. A boolean indicating whether the prepare action can have side effects. It is set to false during pre-commit fast abort check and to true during the persistent flow.
  2. ID of the vote.

The return value is a boolean indicating the participant’s vote (true means “yes”).

commit

List of actions executed on the sites if the coordinator decides to go ahead with the commit. Classy prepends vote ID to the user-specified argument list. Return value is ignored.

rollback

Action executed on the participant when the coordinator decides to abort the commit. Classy prepends vote ID to the user-specified argument list. Return value is ignored.

JavaScript license information