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

Add file watching mode #14

Open
cassaundra opened this issue Dec 27, 2023 · 0 comments
Open

Add file watching mode #14

cassaundra opened this issue Dec 27, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@cassaundra
Copy link
Collaborator

Resolves #10.

Implementation

Usage

Activated with -W/--watch command-line arguments.

Proposed watch mode implementation:

  1. Evaluate the build tree as if in normal run mode.
  2. Initialize file watchers (with notify) on all files according to task sources.
  3. When a file changes, find all tasks that use that file as a source, and re-run all in breadth-first order.

Notes

  • File watch updates should be debounced
    • Needed for batch operations (e.g. git-checkout) and certain editor save file implementations which produce multiple updates for a single file.
    • notify provides notify-debouncer-mini and notify-debouncer-full for this purpose.
  • Interruptible tasks
    • It's convenient to interrupt tasks to save time and restart services (e.g. npm serve).
    • Implement by setting EngineState::ctrlc.
    • In case some cases tasks are sensitive to interruption. Could be resolved with a cleanup block and/or --no-interrupt flag added to tasks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

1 participant