1 Star 0 Fork 0

yzsunjianguo/sponge

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
service.go 460 Bytes
Copy Edit Raw Blame History
yzsunjianguo authored 2024-02-08 14:53 +08:00 . init
package consul
import (
"sync"
"sync/atomic"
"gitee.com/yzsunjianguo/sponge/pkg/servicerd/registry"
)
type serviceSet struct {
serviceName string
watcher map[*watcher]struct{}
services *atomic.Value
lock sync.RWMutex
}
func (s *serviceSet) broadcast(ss []*registry.ServiceInstance) {
s.services.Store(ss)
s.lock.RLock()
defer s.lock.RUnlock()
for k := range s.watcher {
select {
case k.event <- struct{}{}:
default:
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/yzsunjianguo/sponge.git
git@gitee.com:yzsunjianguo/sponge.git
yzsunjianguo
sponge
sponge
v1.0.3

Search