atom/node-pathwatcher

Merely calling require("pathwatcher") keeps the process from exiting

Closed this issue · 0 comments

Minimal repro: node -e 'require("pathwatcher")'

The default behavior seems to be similar to calling fs.watch(file, { persistent: true }), which keeps the event loop alive until all watchers are closed. I would love to have the ability to make pathwatcher.watch non-persistent.

From brief examination, it seems like we need to be calling uv_run(loop, UV_RUN_NOWAIT) somewhere, perhaps instead of uv_async_init(uv_default_loop(), &g_async, MakeCallbackInMainThread), but I'm far from certain about that.

For what it's worth, I'm a Meteor core developer, and I'm trying to incorporate pathwatcher into the Meteor development server, to address meteor/meteor#2135.