Skip to content

Commit

Permalink
Adds a function to format control messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
archaelus committed Jul 8, 2011
1 parent ee29fb0 commit f864884
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/gl_async_bully.erl
Expand Up @@ -98,12 +98,18 @@
name = ?MODULE :: atom()
}).

%% @doc Leader election protocol message.
-type proto_message() :: {halt, election_id()} |
{ack, election_id()} |
{rej, election_id()} |
{norm_p, election_id()} |
{leader, election_id()} |
{not_norm, election_id()}.
{not_norm, election_id()} |
{leader, election_id()}.

%% @doc generic leader election protocol message. Includes ID of sender.
-type control_message() :: {'gl_async_bully',
Sender::node(),
proto_message()}.

-type proto_states() :: norm | wait | elec2.

Expand Down Expand Up @@ -717,3 +723,8 @@ format_mod_status(Fmt, #state{ms={Mod, ModS}}) ->
false ->
{Mod, [{state, ModS}]}
end.

-spec control_message(proto_message()) -> control_message().
%% @doc Format a control_message from the local node.
control_message(Msg) ->
{gl_async_bully, node(), Msg}.

0 comments on commit f864884

Please sign in to comment.