mirror of
https://gitee.com/johng/gf
synced 2026-07-06 21:45:34 +08:00
refract(container/gtype): rename package gtype to gatomic (#4274)
This commit is contained in:
@ -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() {
|
||||
|
||||
@ -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.
|
||||
|
||||
Reference in New Issue
Block a user