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
i think it would be REALLY useful to activate plugins as a config source, specifically:
--json python://package.module:callable()
...would use import package.module; return package.module.callable() as JSON config, whereas:
--ini python://package.module:object
...would use import package.module; return package.module.object as INI config (note: this mirrors the --module, --callable, and --mount syntax)
this would allow me to move our entire config to python (with access to uwsgi.opt hopefully!)... combined with a writable uwsgi.opt (that future config can see!) i'd be ecstatic!
The text was updated successfully, but these errors were encountered:
There are lot of implications in this, as it would means initializing languages vm before the user has configured the environment and so on. There are really a lot of corner cases for it. What about this trick:
UWSGI_AS_LIB=libuwsgi.so make
#!/usr/bin/pythonimportsysimportctypesdefapplication(e, sr):
sr('200 OK',[('Content-Type','text/html')])
return ["Hello World"]
defuwsgi_run(uwsgi_args):
# load the uwsgi library in the global namespaceuwsgi=ctypes.CDLL('./libuwsgi.so',mode=ctypes.RTLD_GLOBAL)
uwsgi_args.insert(0, sys.argv[0])
uwsgi_args.insert(1, '--binary-path')
uwsgi_args.insert(2, sys.argv[0])
# build command line argsargv= (ctypes.c_char_p* (len(uwsgi_args)+1))()
forpos,arginenumerate(uwsgi_args):
argv[pos] =arg# inform the uwsgi engine, the passed environ is not safe to overwriteenvs= (ctypes.c_char_p*1)()
# enter into uWSGI !!!uwsgi.uwsgi_init(len(uwsgi_args), argv, envs)
if__name__=="__main__":
uwsgi_run(['--http-socket', ':9090', '--master', '--processes', '8', '--wsgi-file', sys.argv[0]])
./u.py
you need to use latest code from github as it ensure python is not re-initialized if a vm is already available
i think it would be REALLY useful to activate plugins as a config source, specifically:
--json python://package.module:callable()
...would use
import package.module; return package.module.callable()
as JSON config, whereas:--ini python://package.module:object
...would use
import package.module; return package.module.object
as INI config (note: this mirrors the--module
,--callable
, and--mount
syntax)this would allow me to move our entire config to python (with access to
uwsgi.opt
hopefully!)... combined with a writableuwsgi.opt
(that future config can see!) i'd be ecstatic!The text was updated successfully, but these errors were encountered: