-
Notifications
You must be signed in to change notification settings - Fork 370
Add support of hot code reloading #14
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
Comments
Yeah, this entire concept is something that we definitely need to investigate. |
yepp, we could do it with https://github.com/mkraemer/react-inotify, but it requires indeed a pecl extension. |
Take a look at Facebook's watchman |
@CMCDragonkai, why? It has nothing to do with PHP. |
Shell out to it, or integrate/port the C code? |
What is wrong with react-inotify? |
Nothing is wrong. Its just another implementation. But it supports more operating systems? |
In nodejs apps I usually have the master process actually spawn the workers (as processes), the master process can then listen to If using nginx you can configure it to failover down workers so your users don't see any downtime:
You can make your workers respond with a After this process the master will still have the old code (fine unless you have changed the masters code), but all the workers will have the new code. In ubuntu for example, if you are using upstart, the I haven't looked into this library a lot, but I understand that taking this approach would require changing architecture. Here is a workerpool implementation in js https://gist.github.com/camspiers/075e2e22ca3d7a261d3e |
Another approach could be a lifetime for our workers. Why not respawn them after x requests and/or time anyway? I'm not sure though that would reread php files where cached by code exists? |
I made some of the original hot code loading functionality in PHP, way way back in the PHP3 days. I ported the app to PHP 5.3, but it might be worth a look, even if I haven't actively worked on it in 13+ years ...? http://phpegg.cvs.sourceforge.net/viewvc/phpegg/phpegg/source/mod_ctrl.inc?revision=1.2&view=markup |
@hopeseekr I've looked at the link and can't see anything related to hot reloading? |
Implemented in master, activated through debug option. |
@marcj can you give commit hash where this feature was added? |
It would be nice add support of automatic graceful reloading user's scripts when it's updated.
As I understand - there is one way to do it: graceful restart of workers.
The text was updated successfully, but these errors were encountered: