mirror of
https://github.com/duanhf2012/origin.git
synced 2026-03-06 22:27:36 +08:00
新增OnEndRun接口
This commit is contained in:
@@ -24,6 +24,7 @@ type IModule interface {
|
|||||||
InitModule(module IModule) error
|
InitModule(module IModule) error
|
||||||
OnInit() error
|
OnInit() error
|
||||||
OnRun() bool
|
OnRun() bool
|
||||||
|
OnEndRun()
|
||||||
AddModule(module IModule) bool
|
AddModule(module IModule) bool
|
||||||
GetModuleByType(moduleType uint32) IModule
|
GetModuleByType(moduleType uint32) IModule
|
||||||
GetOwnerService() IService
|
GetOwnerService() IService
|
||||||
@@ -35,7 +36,6 @@ type IService interface {
|
|||||||
OnInit() error
|
OnInit() error
|
||||||
OnEndInit() error
|
OnEndInit() error
|
||||||
OnRun() bool
|
OnRun() bool
|
||||||
OnDestory() error
|
|
||||||
OnFetchService(iservice IService) error
|
OnFetchService(iservice IService) error
|
||||||
OnSetupService(iservice IService) //其他服务被安装
|
OnSetupService(iservice IService) //其他服务被安装
|
||||||
OnRemoveService(iservice IService) //其他服务被安装
|
OnRemoveService(iservice IService) //其他服务被安装
|
||||||
@@ -197,6 +197,10 @@ func (slf *BaseModule) OnRun() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (slf *BaseModule) OnEndRun() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func (slf *BaseModule) GetOwnerService() IService {
|
func (slf *BaseModule) GetOwnerService() IService {
|
||||||
return slf.ownerService
|
return slf.ownerService
|
||||||
}
|
}
|
||||||
@@ -235,5 +239,6 @@ func (slf *BaseModule) RunModule(module IModule, exit chan bool, pwaitGroup *syn
|
|||||||
slf.tickTime = time.Now().UnixNano() / 1e6
|
slf.tickTime = time.Now().UnixNano() / 1e6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.OnEndRun()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user