Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

modified: src/bael_fsm.erl

  • Loading branch information...
commit fd58ad05f1ea766cd7cacaa430f20a308e8204bf 1 parent 9756625
Solomon Ng authored

Showing 1 changed file with 6 additions and 3 deletions. Show diff stats Hide diff stats

  1. +6 3 src/bael_fsm.erl
9 src/bael_fsm.erl
@@ -44,7 +44,7 @@ code_change(_OldVsn, _StateName, StateData, _Extra)->
44 44 idle({timeout, _Ref, Msg}, StateData)->
45 45 io:format("handle start_timer: ~p~n", [Msg]),
46 46 io:format("fsm(~p) state: idle~n", [self()]),
47   - {next_state, idle, StateData};
  47 + {next_state, work, StateData, 5000};
48 48 idle(Event, StateData)->
49 49 io:format("handle send_event: ~p~n", [Event]),
50 50 io:format("fsm(~p) state: idle~n", [self()]),
@@ -55,12 +55,15 @@ idle(Event, From, StateData)->
55 55 io:format("fsm(~p) state: idle~n", [self()]),
56 56 {reply, {self(), reply}, idle, StateData}.
57 57
  58 +work(timeout, StateDate)->
  59 + io:format("fsm(~p) finish work~n", [self()]),
  60 + {next_state, idle, StateDate};
58 61 work(Event, StateData)->
59 62 io:format("handle send_event: ~p~n", [Event]),
60 63 io:format("fsm(~p) state: work~n", [self()]),
61   - {next_state, idle, StateData}.
  64 + {next_state, work, StateData}.
62 65
63 66 work(Event, From, StateData)->
64 67 io:format("handle sync_send_event(from ~p): ~p~n", [From, Event]),
65 68 io:format("fsm(~p) state: work~n", [self()]),
66   - {reply, {self(), reply}, idle, StateData}.
  69 + {reply, {self(), reply}, work, StateData}.

0 comments on commit fd58ad0

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