Skip to content
Browse files

modified: src/bael_fsm.erl

  • Loading branch information...
1 parent 9756625 commit fd58ad05f1ea766cd7cacaa430f20a308e8204bf @solomonwzs committed Apr 11, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/bael_fsm.erl
View
9 src/bael_fsm.erl
@@ -44,7 +44,7 @@ code_change(_OldVsn, _StateName, StateData, _Extra)->
idle({timeout, _Ref, Msg}, StateData)->
io:format("handle start_timer: ~p~n", [Msg]),
io:format("fsm(~p) state: idle~n", [self()]),
- {next_state, idle, StateData};
+ {next_state, work, StateData, 5000};
idle(Event, StateData)->
io:format("handle send_event: ~p~n", [Event]),
io:format("fsm(~p) state: idle~n", [self()]),
@@ -55,12 +55,15 @@ idle(Event, From, StateData)->
io:format("fsm(~p) state: idle~n", [self()]),
{reply, {self(), reply}, idle, StateData}.
+work(timeout, StateDate)->
+ io:format("fsm(~p) finish work~n", [self()]),
+ {next_state, idle, StateDate};
work(Event, StateData)->
io:format("handle send_event: ~p~n", [Event]),
io:format("fsm(~p) state: work~n", [self()]),
- {next_state, idle, StateData}.
+ {next_state, work, StateData}.
work(Event, From, StateData)->
io:format("handle sync_send_event(from ~p): ~p~n", [From, Event]),
io:format("fsm(~p) state: work~n", [self()]),
- {reply, {self(), reply}, idle, StateData}.
+ {reply, {self(), reply}, work, StateData}.

0 comments on commit fd58ad0

Please sign in to comment.
Something went wrong with that request. Please try again.