Initial reference to this handle.
Filesystem path to be watched.
Watcher-specific options
Logging and parcel watcher options
The client to forward events to.
Amount of time in ms to wait once this handle is not referenced anymore.
Protected
debugUsed for debugging to keep track of the watchers.
Protected
Readonly
deferredThis deferred only rejects with WatcherDisposal
and never resolves.
Protected
Readonly
deferredAmount of time in ms to wait once this handle is not referenced anymore.
Protected
deferredWhen the ref count hits zero, we schedule this watch handle to be disposed.
Protected
disposedProtected
Readonly
fileThe client to forward events to.
Readonly
fsFilesystem path to be watched.
Protected
parcelEnsures that events are processed in the order they are emitted, despite being processed async.
Protected
Readonly
parcelLogging and parcel watcher options
Protected
Readonly
refsWe count each reference made to this watcher, per client.
We do this to know where to send events via the network.
An entry should be removed when its value hits zero.
Protected
watcherWhen this field is set, it means the watcher instance was successfully started.
Readonly
watcherWatcher-specific options
Readonly
whenResolves once this handle disposed itself and its resources. Never throws.
Readonly
whenPromise that resolves when the watcher is fully started, or got disposed.
Will reject if an error occurred while starting.
true
if successfully started, false
if disposed early.
Static
Protected
debugProtected
_disposeProtected
assertwith WatcherDisposal if this instance is disposed.
Protected
createProtected
debugProtected
fireProtected
handleProtected
infoProtected
isProtected
onProtected
onProtected
pushProtected
resolveProtected
startProtected
stop
Because URIs can be watched by different clients, we'll track how many are listening for a given URI.
This component wraps the whole start/stop process given some reference count.
Once there are no more references the handle will wait for some time before destroying its resources.