block 테스트 함수 추가

This commit is contained in:
2023-12-28 16:55:38 +09:00
parent bb9b3a9735
commit d5708a964f
3 changed files with 27 additions and 22 deletions

View File

@ -84,24 +84,6 @@ func (p *memberContainerPtr[K, T]) all() []T {
return out
}
func (p *memberContainerPtr[K, T]) contains(key K, out *T) bool {
ptr := atomic.LoadPointer(&p.ptr)
src := (*map[K]T)(ptr)
found, exists := (*src)[key]
if exists {
if found.Expired() {
p.remove(key)
return false
}
if out != nil {
out = &found
}
return true
}
return false
}
func (p *memberContainerPtr[K, T]) watchCollection(parentctx context.Context, coll gocommon.CollectionName, mc gocommon.MongoClient) {
defer func() {
s := recover()