> Hi ... > > I have tried to play a bit more with uwsgi, and have made a simple and > well working C++11 (std::function) interface what is able to build using > CMake. > > This works well, and I now can see how the threads are working (like I > hoped and expected). See > https://github.com/druppy/spikes/blob/master/cpp/uwsgi/test_handler.cpp > :-) > > Now in order to move as much code as possible to uwsgi config (as > recommended) , I really like to be able to use the mount / apps idea, > but I am a bit lost as to how to do this. > > There is this : > > struct uwsgi_app *uwsgi_add_app(int, uint8_t, char *, int, void *, > void *); > > in the header file, but I really like to know what the argument are, and > if I need to do something to returning structure in order to make the > app ready. > > I know this it originally written to support python, but this is so > tempting to try use in C++ :-) > > Thanks for a really nice project, I will try to use in more and more > places as it adds much flexibility to my production systems. > > Kind regards >
the first int field is the application id (a simple number). You can get the first available app_id using the uwsgi_apps_cnt macro. The second uint8_t is the modifier1. Then you have a char * and a int thatyou can use as the mount point (like "/foobar", 7 ). The last two fields are for your specific needs. Every plugin makes a different use of them. You can (as an example) store the function pointer of the code to call for every mountpoint and so on: // example from the psgi plugin int id = uwsgi_apps_cnt; struct uwsgi_app *wi = uwsgi_add_app(id, psgi_plugin.modifier1, "/foo", 4, interpreters, callables); -- Roberto De Ioris http://unbit.com _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
