Simplify Service/Reactor pattern

This commit is contained in:
Jae Kwon
2015-07-22 06:21:21 -07:00
parent 7441e322d0
commit e7c1febb65
14 changed files with 67 additions and 56 deletions
+4 -2
View File
@@ -31,12 +31,14 @@ func NewEventSwitch() *EventSwitch {
return evsw
}
func (evsw *EventSwitch) AfterStart() {
func (evsw *EventSwitch) OnStart() {
evsw.BaseService.OnStart()
evsw.eventCells = make(map[string]*eventCell)
evsw.listeners = make(map[string]*eventListener)
}
func (evsw *EventSwitch) AfterStop() {
func (evsw *EventSwitch) OnStop() {
evsw.BaseService.OnStop()
evsw.eventCells = nil
evsw.listeners = nil
}