Fix argument order for plain_fsm:handle_system_msg

plain_fsm documentation was wrong https://github.com/uwiger/plain_fsm/pull/4, so now it should be able to send sys messages
to hanoi.
This commit is contained in:
Kresten Krab Thorup 2014-02-14 08:25:26 -05:00
parent e3689c3d87
commit e37623a84c
2 changed files with 3 additions and 3 deletions

View file

@ -102,7 +102,7 @@ initialize(State, PrefixFolders) ->
%% gen_fsm handling %% gen_fsm handling
{system, From, Req} -> {system, From, Req} ->
plain_fsm:handle_system_msg( plain_fsm:handle_system_msg(
From, Req, State, fun(S1) -> initialize(S1, PrefixFolders) end); Req, From, State, fun(S1) -> initialize(S1, PrefixFolders) end);
{'DOWN', MRef, _, _, _} when MRef =:= State#state.sendto_ref -> {'DOWN', MRef, _, _, _} when MRef =:= State#state.sendto_ref ->
ok; ok;
@ -164,7 +164,7 @@ fill_from_inbox(State, Values, Queues, [PID|_]=PIDs, SavePIDs) ->
%% gen_fsm handling %% gen_fsm handling
{system, From, Req} -> {system, From, Req} ->
plain_fsm:handle_system_msg( plain_fsm:handle_system_msg(
From, Req, State, fun(S1) -> fill_from_inbox(S1, Values, Queues, PIDs, SavePIDs) end); Req, From, State, fun(S1) -> fill_from_inbox(S1, Values, Queues, PIDs, SavePIDs) end);
{'DOWN', MRef, _, _, _} when MRef =:= State#state.sendto_ref -> {'DOWN', MRef, _, _, _} when MRef =:= State#state.sendto_ref ->
ok; ok;

View file

@ -632,7 +632,7 @@ main_loop(State = #state{ next=Next }) ->
%% gen_fsm handling %% gen_fsm handling
{system, From, Req} -> {system, From, Req} ->
plain_fsm:handle_system_msg( plain_fsm:handle_system_msg(
From, Req, State, fun(S1) -> main_loop(S1) end); Req, From, State, fun(S1) -> main_loop(S1) end);
{'EXIT', Parent, Reason} -> {'EXIT', Parent, Reason} ->
plain_fsm:parent_EXIT(Reason, State); plain_fsm:parent_EXIT(Reason, State);