Coder Social home page Coder Social logo

age-out watches about watchman HOT 11 CLOSED

facebook avatar facebook commented on May 5, 2024
age-out watches

from watchman.

Comments (11)

sunshowers avatar sunshowers commented on May 5, 2024

There's no refcounting for watches, though that wouldn't be a bad feature request.

from watchman.

wez avatar wez commented on May 5, 2024

I've been thinking about adding an aging feature for watches. The idea is that you would specify a global configuration with the idle parameters. If the watch has no registered triggers and no connected subscribers, and has not had any queries and has not processed any change notifications for the specified amount of time, we could have watchman automatically cancel the watch.

Meanwhile, don't watch-del unless you know that you own the watch. The watch can be manually cancelled by the user, and will be automatically cancelled when the dir is removed.

from watchman.

amasad avatar amasad commented on May 5, 2024

Is there a way to know if I completely own the watch?
(maybe do watch-list before watching?)

from watchman.

wez avatar wez commented on May 5, 2024

No, there's not a great way to know whether another tool might be interested and actively watching. Since we allow non-persistent polling (eg: you don't need to maintain a socket connection between queries), there isn't a way to know for sure who might want the watch to continue existing, which is why a solution to this is most likely to be implemented by automatically aging out watches as I mentioned above.

from watchman.

amasad avatar amasad commented on May 5, 2024

Yes, this seems like the best solution. However, this isn't really an issue right now, I'll let you know if it becomes a pressing one.

from watchman.

wez avatar wez commented on May 5, 2024

I think the new watch-project stuff obviates the need for this. I'm going to close this issue; we can revisit if needed in the future.

from watchman.

stefanpenner avatar stefanpenner commented on May 5, 2024

@wez I would like to still plead my case for a watcher decay of some reasonable half-life.

I still need to update ember-cli to take better advantage of watchman, but even with that (and watch-project) I believe a watcher decay would make watchman a much better citizen.

In my developer workflow it is not uncommon to for me to check out various projects a day, each one then indefinitely leaks watchers.

Why would I checkout another project?

  • preview an add-on demo
  • fix a bug in an add-on
  • code-review
  • creating a new add-on
  • creating a new app
  • creating a new reproduction of an error scenario

Theoretically solutions:

  • conventionalize a shared root for all these activities, and watch the root

    unfortunately, this will likely be difficult to conventionalize across the larger OSS community

from watchman.

wez avatar wez commented on May 5, 2024

OK, let's re-open under a different name

from watchman.

wez avatar wez commented on May 5, 2024

We have https://reviews.facebook.net/D37701 in review as a possible implementation of this feature

from watchman.

wez avatar wez commented on May 5, 2024

This has landed in master and will be part of Watchman 3.7 that we're cutting this week

from watchman.

stefanpenner avatar stefanpenner commented on May 5, 2024

nice, thanks @wez

from watchman.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.