Hello internals,
How hard would be to add an unload (or reload) feature for
classes/interfaces?
I'm wondering with regards to running PHP as a deamon (with Swoole or
ReactPHP, etc.) could it be made possible to hot-reload e.g. for
controllers and view-models?
Of course, the other option is to launch worker sub-processes under some
sort of host process, and then restart the workers after a change - this
adds communication overhead between the host/worker processes though, and a
layer of complexity.
Another option is if a reverse proxy (NGINX maybe) could restart the actual
application daemon, but that means you have a dependency on a specific
reverse proxy.
So I know there are other options, but I'm looking for the simplest and
cleanest way to do this, and I'd prefer to stay within the language.
Other dynamic languages (where daemonizing is "normal", like Ruby, JS and
Python) have this feature and it is often used to hot-reload
controllers/views in web-apps.
Any thoughts?