place holder function

pull/370/head
Minh Doan 6 years ago committed by Minh Doan
parent 50e1f1664c
commit 6fb68de941
  1. 26
      node/service/role_conversion.go

@ -16,26 +16,28 @@ func NewRoleConversion() *RoleConversion {
}
// StartService starts role conversion service.
func (cs *RoleConversion) StartService() {
cs.stopChan = make(chan struct{})
cs.stoppedChan = make(chan struct{})
func (rc *RoleConversion) StartService() {
rc.stopChan = make(chan struct{})
rc.stoppedChan = make(chan struct{})
cs.Init()
cs.Run(cs.stopChan, cs.stoppedChan)
rc.Init()
rc.Run(rc.stopChan, rc.stoppedChan)
}
// Init initializes role conversion service.
func (cs *RoleConversion) Init() {
func (rc *RoleConversion) Init() {
}
// Run runs role conversion.
func (cs *RoleConversion) Run(stopChan chan struct{}, stoppedChan chan struct{}) {
func (rc *RoleConversion) Run(stopChan chan struct{}, stoppedChan chan struct{}) {
go func() {
defer close(stoppedChan)
for {
select {
default:
utils.GetLogInstance().Info("Running role conversion")
// TODO: Write some logic here.
rc.DoRoleConversion()
case <-stopChan:
return
}
@ -43,10 +45,14 @@ func (cs *RoleConversion) Run(stopChan chan struct{}, stoppedChan chan struct{})
}()
}
// DoRoleConversion does role conversion.
func (rc *RoleConversion) DoRoleConversion() {
}
// StopService stops role conversion service.
func (cs *RoleConversion) StopService() {
func (rc *RoleConversion) StopService() {
utils.GetLogInstance().Info("Stopping role conversion service.")
cs.stopChan <- struct{}{}
<-cs.stoppedChan
rc.stopChan <- struct{}{}
<-rc.stoppedChan
utils.GetLogInstance().Info("Role conversion stopped.")
}

Loading…
Cancel
Save