Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant