Closed dktapps closed 1 year ago
Another possible option might be to add some kind of INHERIT_LOCAL_CODE
option, which inherits only the classes/functions/constants declared within the same file as the thread class itself. This seems like a workable option for both single-file scripts and PSR-style autoloaded applications.
Since there's no one-size-fits-all for this, we require the user to specify it.
For single-file scripts, it'll usually be necessary to use INHERIT_ALL, since you'll probably want to use classes, functions and constants in the same file that can't be autoloaded. For production applications, which usually follow a one-class-per-file rule, INHERIT_NONE or INHERIT_INI is preferable, since these have significantly less overhead and use much less memory.
Unaddressed issues
Pool
's workers other than setting a custom Worker class which overridesstart()
. This isn't ideal. However, we could also just removePool
anyway, since PM doesn't use it.INHERIT_DEFAULT
option, which inherits the recommended minimal stuff?