Browse Source

QuitService->BaseService

pull/456/head
Jae Kwon 8 years ago
committed by Ethan Buchman
parent
commit
bd353e004a
2 changed files with 6 additions and 6 deletions
  1. +4
    -4
      addrbook.go
  2. +2
    -2
      switch.go

+ 4
- 4
addrbook.go View File

@ -75,7 +75,7 @@ const (
/* AddrBook - concurrency safe peer address manager */
type AddrBook struct {
QuitService
BaseService
mtx sync.Mutex
filePath string
@ -106,7 +106,7 @@ func NewAddrBook(filePath string, routabilityStrict bool) *AddrBook {
routabilityStrict: routabilityStrict,
}
am.init()
am.QuitService = *NewQuitService(log, "AddrBook", am)
am.BaseService = *NewBaseService(log, "AddrBook", am)
return am
}
@ -126,7 +126,7 @@ func (a *AddrBook) init() {
}
func (a *AddrBook) OnStart() error {
a.QuitService.OnStart()
a.BaseService.OnStart()
a.loadFromFile(a.filePath)
a.wg.Add(1)
go a.saveRoutine()
@ -134,7 +134,7 @@ func (a *AddrBook) OnStart() error {
}
func (a *AddrBook) OnStop() {
a.QuitService.OnStop()
a.BaseService.OnStop()
a.wg.Wait()
}


+ 2
- 2
switch.go View File

@ -26,13 +26,13 @@ type Reactor interface {
//--------------------------------------
type BaseReactor struct {
QuitService // Provides Start, Stop, .Quit
BaseService // Provides Start, Stop, .Quit
Switch *Switch
}
func NewBaseReactor(log log15.Logger, name string, impl Reactor) *BaseReactor {
return &BaseReactor{
QuitService: *NewQuitService(log, name, impl),
BaseService: *NewBaseService(log, name, impl),
Switch: nil,
}
}


Loading…
Cancel
Save