(from, to State, stateFn func())
| 142 | } |
| 143 | |
| 144 | func (b *BasicService) mustSwitchState(from, to State, stateFn func()) { |
| 145 | if ok, _ := b.switchState(from, to, stateFn); !ok { |
| 146 | panic("switchState failed") |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // This is the "main" method, that does most of the work of service. |
| 151 | // Service is in Starting state when this method runs. |