MCPcopy
hub / github.com/docker/compose / naiveNotify

Struct naiveNotify

pkg/watch/watcher_naive.go:39–55  ·  view source on GitHub ↗

A naive file watcher that uses the plain fsnotify API. Used on all non-Darwin systems (including Windows & Linux). All OS-specific codepaths are handled by fsnotify.

Source from the content-addressed store, hash-verified

37//
38// All OS-specific codepaths are handled by fsnotify.
39type naiveNotify struct {
40 // Paths that we're watching that should be passed up to the caller.
41 // Note that we may have to watch ancestors of these paths
42 // in order to fulfill the API promise.
43 //
44 // We often need to check if paths are a child of a path in
45 // the notify list. It might be better to store this in a tree
46 // structure, so we can filter the list quickly.
47 notifyList map[string]bool
48
49 isWatcherRecursive bool
50 watcher *fsnotify.Watcher
51 events chan fsnotify.Event
52 wrappedEvents chan FileEvent
53 errors chan error
54 numWatches int64
55}
56
57func (d *naiveNotify) Start() error {
58 if len(d.notifyList) == 0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected