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

Link to this function

handle_message(Mod, Msg, State)

View Source
-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()}.
Link to this function

join(Mod, NodeSpec, PeerState, LocalState)

View Source
-spec join(Mod :: module(), NodeSpec :: partisan:node_spec(), PeerState :: any(), LocalState :: any()) ->
        {ok, membership_list(), outgoing_messages(), NewState :: any()}.
Link to this function

leave(Mod, NodeSpec, State)

View Source
-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()}.
Link to this function

prune(Mod, NodeSpecs, State)

View Source
-spec prune(Mod :: module(), [partisan:node_spec()], State :: any()) ->
         {ok, membership_list(), NewState :: any()}.