You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No, mod_wsgi doesn't have one because under mod_wsgi there is no equivalent situation whereby your application code is loaded into a parent process, with that then being forked to create the worker processes which accept requests. In mod_wsgi the Python interpreter is initialised and your application loaded fresh in each process.
Note, you should never use obsolete option WSGILazyInitialization which would result in Python being initialized in the parent process as it is a huge security risk and for many Python versions leaks memory. Even if you had enabled that obsolete option, your application is still not preloaded in the parent process so any such post fork handler is not needed.
Why do you think you the an equivalent for the uWSGI feature?
I was just wondering if there was such a thing. I'm implementing an SDK that supports two multi-process modes, one that requires an external sync service and a Redis cache, and another that can run on preforked web servers such as uWSGI or GUnicorn. I was wondering if it would be possible to use mod_wsgi for that. Thank you very much for your answer! I really appreciate it!
The uwsgidecorators package has a postfork decorator that can be used to run code after
fork()
. Does mod_wsgi have an event handler similar to that?https://uwsgi-docs.readthedocs.io/en/latest/PythonDecorators.html#uwsgidecorators.postfork
The text was updated successfully, but these errors were encountered: