Simplify Service/Reactor pattern

This commit is contained in:
Jae Kwon
2015-07-21 18:31:01 -07:00
parent 7441e322d0
commit e7c1febb65
14 changed files with 67 additions and 56 deletions

View File

@@ -360,12 +360,14 @@ func (cs *ConsensusState) NewStepCh() chan *RoundState {
return cs.newStepCh
}
func (cs *ConsensusState) AfterStart() {
func (cs *ConsensusState) OnStart() {
cs.BaseService.OnStart()
cs.scheduleRound0(cs.Height)
}
func (cs *ConsensusState) AfterStop() {
func (cs *ConsensusState) OnStop() {
// It's mostly asynchronous so, there's not much to stop.
cs.BaseService.OnStop()
}
// EnterNewRound(height, 0) at cs.StartTime.