-
-
Notifications
You must be signed in to change notification settings - Fork 208
File watching in development environments #458
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
Conversation
- Implement listener to capture aformentioned event and invoke pipeline - Implement 1 default pipeline step: restarting queue workers - Test case asserting pipeline is invoked - Test case asserting queue restart initiated
|
If this is about queues, a simpler change would be to use |
|
Agreed. Great suggestion @SRWieZ I do like the idea of a file watcher as a general-purpose tool tho, that has come up before as a feature some have wanted or looked to implement in other ways... |
|
I like the idea of a file watcher, especially for production applications, not just for development. It could be facade, we can provide a directory and a custom event that is triggered with Although I'm not for adding dependencies, I believe that https://github.com/paulmillr/chokidar is a better option than fs.watch, as explained in their README. It is a well-known and widely used library too. Currently, I use chokidar with spatie/file-system-watcher, but the built version of my app requires the user to have Node installed on their system. I was planning to add |
The principle applies to all child processes, not just queue workers. Restarting queue workers was just one functionality I exposed as a demonstration.
So even with this, we'd probably have to split it up so it uses
Yep, I wanted to use chokidar too but avoided it so as not to add more dependencies. |
|
Superseded by #587 - Thank you for your contribution. |
|
I see the value in #587, but I also think that a generic watcher tool using something like chokidar would be really great to have and would benefit all apps. Does someone feel up to getting that going? |
Note
Accompanying PR on the Electron side should be merged together with this
I was torn as to whether this should be something we even handle. It's sort of a grey area, and I still don't know if it's appropriate for us to provide this functionality. Perhaps we can provide the event only, and allow the user to add their own pipeline steps if they are so inclined.
Feel free to throw out parts of it – or even the whole thing.