Theia API Documentation v1.77.0
    Preparing search index...

    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.

    Hierarchy (View Summary)

    Index
    deferredDisposalTimeout: number = 10_000

    Amount of time in ms to wait once this handle is not referenced anymore.

    deferredDisposalTimer: Timeout | undefined

    When the ref count hits zero, we schedule this watch handle to be disposed.

    fileSystemWatcherClient: FileSystemWatcherServiceClient

    The client to forward events to.

    fsPath: string

    Filesystem path to be watched.

    parcelEventProcessingQueue: Promise<void> = ...

    Ensures that events are processed in the order they are emitted, despite being processed async.

    parcelFileSystemWatchServerOptions: ParcelFileSystemWatcherServerOptions

    Logging and parcel watcher options

    refsPerClient: Map<number, { value: number }> = ...

    We 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.

    target: string

    Path this watcher was asked about; the subclass decides what it resolves to.

    watcher: AsyncSubscription | undefined

    When this field is set, it means the watcher instance was successfully started.

    watcherOptions: ParcelWatcherExcludes

    Watcher-specific options

    whenDisposed: Promise<void> = ...

    Resolves once this watcher disposed itself. Never rejects.

    whenStarted: Promise<boolean>

    Promise 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.

    • When references hit zero, we'll schedule disposal for a bit later.

      This allows new references to reuse this watcher instead of creating a new one.

      e.g. A frontend disconnects for a few milliseconds before reconnecting again.

      Returns void