refract(container/gtype): rename package gtype to gatomic (#4274)

This commit is contained in:
John Guo
2025-05-07 19:11:44 +08:00
committed by GitHub
parent f52b7de1cf
commit 1f2fcd39b1
69 changed files with 312 additions and 312 deletions

View File

@ -9,8 +9,8 @@ package file
import (
"context"
"github.com/gogf/gf/v3/container/gatomic"
"github.com/gogf/gf/v3/container/gmap"
"github.com/gogf/gf/v3/container/gtype"
"github.com/gogf/gf/v3/frame/g"
"github.com/gogf/gf/v3/net/gsvc"
"github.com/gogf/gf/v3/os/gfile"
@ -56,7 +56,7 @@ func (r *Registry) Watch(ctx context.Context, key string) (watcher gsvc.Watcher,
prefix: key,
discovery: r,
ch: make(chan gsvc.Service, 100),
closed: gtype.NewBool(false),
closed: gatomic.NewBool(false),
}
_, err = gfsnotify.Add(r.path, func(event *gfsnotify.Event) {
if fileWatcher.closed.Val() {

View File

@ -9,7 +9,7 @@ package file
import (
"context"
"github.com/gogf/gf/v3/container/gtype"
"github.com/gogf/gf/v3/container/gatomic"
"github.com/gogf/gf/v3/errors/gerror"
"github.com/gogf/gf/v3/net/gsvc"
)
@ -19,7 +19,7 @@ type Watcher struct {
prefix string // Watched prefix key, not file name prefix.
discovery gsvc.Discovery // Service discovery.
ch chan gsvc.Service // Changes that caused by inotify.
closed *gtype.Bool // Whether the channel has been closed
closed *gatomic.Bool // Whether the channel has been closed
}
// Proceed proceeds watch in blocking way.