Re: How to create a python extension module from a shared library?

2018-01-03 Thread James Chapman
In my opinion, just write your extension in C following the traditional extension development guidelines unless you plan to actively maintain and contribute your changes in the relevant projects (CFFI and uWSGI). Assuming you get this to work, you're going to have to support it and bug fix it. Som

Re: How to create a python extension module from a shared library?

2018-01-02 Thread James Chapman
Again, apologies if I've dumbed this down, but if I understand this all correctly... The webserver starts uWSGI, the python application running within then does stuff via uWSGI. You want one of those things to be handled by a uWSGI extension that has been written in python, with CFFI, rather than

Re: How to create a python extension module from a shared library?

2018-01-02 Thread James Chapman
I have an example of loading and communicating with a dynamic library using ctypes in Windows here: https://github.com/James-Chapman/python-code-snippets/tree/master/DLL_C_funcs_w_callbacks It shouldn't be too dissimilar on Linux. What starts uWSGI? Is it started from a Python application

Re: How to create a python extension module from a shared library?

2018-01-02 Thread James Chapman
Hi Etienne, I'm not familiar with uSWGI, so I started here: https://uwsgi-docs.readthedocs.io/en/latest/Hooks.html AFAIK there are a number of hooks already exposed and available to Python apps. However, if I've understood your question correctly, you want to extend uWSGI itself by writing some p