View Source amoc_coordinator (amoc v3.3.0)
Summary
Functions
See also: add/3.
Adds the current process data. Usually called in the
start/2
callback of an amoc scenario.Resets a coordinator, that is, calls all coordination actions with
reset
as the coordination data.See also: start/3.
Starts a coordinator. Usually called in the init callback of an amoc scenario.
Stops a coordinator.
Types
-type action() :: fun((coordination_event(), [data()]) -> any()) | fun((coordination_event(), maybe_coordination_data(), maybe_coordination_data()) -> any()) | fun((coordination_event()) -> any()).
-type coordination_event() :: {event_type(), non_neg_integer()}.
-type coordination_item() :: {num_of_users(), coordination_actions()}.
-type coordination_timeout_in_sec() :: pos_integer() | infinity.
-type event_type() :: coordinate | timeout | stop | reset.
-type maybe_coordination_data() :: data() | undefined.
-type name() :: term().
-type normalized_coordination_item() :: {NoOfUsers :: pos_integer() | all, [action()]}.
-type num_of_users() :: pos_integer() | {Min :: pos_integer(), Max :: pos_integer()} | all.
-type plan() :: [coordination_item()] | coordination_item().
Functions
See also: add/3.
start/2
callback of an amoc scenario.
-spec reset(name()) -> ok.
reset
as the coordination data.
See also: start/3.
-spec start(name(), plan(), coordination_timeout_in_sec()) -> ok | error.
-spec stop(name()) -> ok.