View Source partisan_membership_strategy behaviour (partisan v5.0.0-rc.8)
Summary
Types
-type membership_list() :: [partisan:node_spec()].
-type outgoing_message() :: {node(), partisan:message()}.
-type outgoing_messages() :: [outgoing_message()].
Callbacks
-callback compare(Members :: membership_list(), State :: any()) -> {Joiners :: membership_list(), Leavers :: membership_list()}.
-callback handle_message(partisan:message(), State :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-callback init(partisan:actor()) -> {ok, membership_list(), State :: any()}.
-callback join(NodeSpec :: partisan:node_spec(), PeerState :: any(), LocalState :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-callback leave(NodeSpec :: partisan:node_spec(), State :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-callback periodic(State :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-callback prune([NodeSpec :: partisan:node_spec()], State :: any()) -> {ok, membership_list(), NewState :: any()}.
Functions
-spec handle_message(Mod :: module(), partisan:message(), State :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-spec init(Mod :: module(), partisan:actor()) -> {ok, membership_list(), State :: any()}.
-spec join(Mod :: module(), NodeSpec :: partisan:node_spec(), PeerState :: any(), LocalState :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-spec leave(Mod :: module(), partisan:node_spec(), State :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-spec periodic(Mod :: module(), State :: any()) -> {ok, membership_list(), outgoing_messages(), NewState :: any()}.
-spec prune(Mod :: module(), [partisan:node_spec()], State :: any()) -> {ok, membership_list(), NewState :: any()}.