add facility for changing stateTimeout dynamically
This commit is contained in:
parent
66595b75bf
commit
bcdb429573
1 changed files with 8 additions and 0 deletions
|
|
@ -226,6 +226,14 @@ trait FSM[S, D] {
|
|||
*/
|
||||
protected final def timerActive_?(name: String) = timers contains name
|
||||
|
||||
/**
|
||||
* Set state timeout explicitly. This method can safely be used from within a
|
||||
* state handler.
|
||||
*/
|
||||
protected final def setStateTimeout(state : S, timeout : Timeout) {
|
||||
stateTimeouts(state) = timeout
|
||||
}
|
||||
|
||||
/**
|
||||
* Set handler which is called upon each state transition, i.e. not when
|
||||
* staying in the same state.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue