Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an event when watchers are ready #71

Closed
Krinkle opened this issue Dec 28, 2018 · 0 comments
Closed

Provide an event when watchers are ready #71

Krinkle opened this issue Dec 28, 2018 · 0 comments

Comments

@Krinkle
Copy link
Contributor

Krinkle commented Dec 28, 2018

The hardcoded delay of 200ms in has-native-recursive.js means that on Linux, there are is no watcher existing during the first 200ms after calling watch(dir, options).

This is okay, but I think it would be good for users of node-watch to not have to hardcode this number in their own code.

Instead, perhaps we can emit a ready event once this check has finished and consumers can expect events to fire.

Krinkle added a commit to Krinkle/node-watch that referenced this issue Dec 28, 2018
This is fires once the watchers are created.

* For single files,
  this happens immediately.

* For directories on macOS/Windows (recursive, and non-recursive)
  this happens after hasNativeRecursive() callback.

* For directories on Linux (non-recursive)
  this happens after hasNativeRecursive() callback.

* For directories on Linux (recursive)
  this happens after hasNativeRecursive() callback and after
  each recursive call to watchDirectory() via getSubDirectories()
  is completed. To keep track of this, use a counting semaphore.

Fixes yuanchuan#71
Krinkle added a commit to Krinkle/node-watch that referenced this issue Dec 28, 2018
This is fires once the watchers are created.

* For single files,
  this happens immediately.

* For directories on macOS/Windows (recursive, and non-recursive)
  this happens after hasNativeRecursive() callback.

* For directories on Linux (non-recursive)
  this happens after hasNativeRecursive() callback.

* For directories on Linux (recursive)
  this happens after hasNativeRecursive() callback and after
  each recursive call to watchDirectory() via getSubDirectories()
  is completed. To keep track of this, use a counting semaphore.

Fixes yuanchuan#71
Krinkle added a commit to Krinkle/node-watch that referenced this issue Dec 28, 2018
This is fires once the watchers are created.

* For single files,
  this happens immediately.

* For directories on macOS/Windows (recursive, and non-recursive)
  this happens after hasNativeRecursive() callback.

* For directories on Linux (non-recursive)
  this happens after hasNativeRecursive() callback.

* For directories on Linux (recursive)
  this happens after hasNativeRecursive() callback and after
  each recursive call to watchDirectory() via getSubDirectories()
  is completed. To keep track of this, use a counting semaphore.

Fixes yuanchuan#71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant