Skip to content

Commit

Permalink
fix change listener
Browse files Browse the repository at this point in the history
  • Loading branch information
zouyx committed Jun 25, 2020
1 parent bf3b500 commit db1448c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions start.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package agollo

import (
"container/list"
"github.com/zouyx/agollo/v3/agcache"
_ "github.com/zouyx/agollo/v3/agcache/memory"
"github.com/zouyx/agollo/v3/cluster"
Expand Down Expand Up @@ -77,6 +78,21 @@ func SetCache(cacheFactory agcache.CacheFactory) {
}
}

//AddChangeListener 增加变更监控
func AddChangeListener(listener storage.ChangeListener) {
storage.AddChangeListener(listener)
}

//RemoveChangeListener 增加变更监控
func RemoveChangeListener(listener storage.ChangeListener) {
storage.AddChangeListener(listener)
}

//GetChangeListeners 获取配置修改监听器列表
func GetChangeListeners() *list.List {
return storage.GetChangeListeners()
}

func startAgollo() error {
// 有了配置之后才能进行初始化
if err := env.InitConfig(initAppConfigFunc); err != nil {
Expand Down

0 comments on commit db1448c

Please sign in to comment.