MCPcopy
hub / github.com/rclone/rclone / ChangeNotify

Method ChangeNotify

backend/cache/cache.go:885–894  ·  view source on GitHub ↗

ChangeNotify can subscribe multiple callers this is coupled with the wrapped fs ChangeNotify (if it supports it) and also notifies other caches (i.e VFS) to clear out whenever something changes

(ctx context.Context, notifyFunc func(string, fs.EntryType), pollInterval <-chan time.Duration)

Source from the content-addressed store, hash-verified

883// this is coupled with the wrapped fs ChangeNotify (if it supports it)
884// and also notifies other caches (i.e VFS) to clear out whenever something changes
885func (f *Fs) ChangeNotify(ctx context.Context, notifyFunc func(string, fs.EntryType), pollInterval <-chan time.Duration) {
886 f.parentsForgetMu.Lock()
887 defer f.parentsForgetMu.Unlock()
888 fs.Debugf(f, "subscribing to ChangeNotify")
889 f.parentsForgetFn = append(f.parentsForgetFn, notifyFunc)
890 go func() {
891 for range pollInterval {
892 }
893 }()
894}
895
896// Name of the remote (as passed into NewFs)
897func (f *Fs) Name() string {

Callers

nothing calls this directly

Calls 3

DebugfFunction · 0.92
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected