Re: [QGIS-Developer] asyncio in plugins?

2021-03-23 Thread Nyall Dawson
On Wed, 24 Mar 2021 at 06:15, David Marteau wrote: > > > You should be aware that call to Qgis C/C++ api from Python hold the GIL > and may prevent custom python threads to run. Actually almost all of the PyQGIS methods release the GIL before they call c++ code. The only exceptions are very

Re: [QGIS-Developer] asyncio in plugins?

2021-03-23 Thread David Marteau
You should be aware that call to Qgis C/C++ api from Python hold the GIL and may prevent custom python threads  to run. Le 23/03/2021 à 21:06, Sebastian M. Ernst a écrit : Hi David, I suspected this much. In theory, I can move the event loop into a separate thread [1, 2] - this should

Re: [QGIS-Developer] asyncio in plugins?

2021-03-23 Thread Sebastian M. Ernst
Hi David, I suspected this much. In theory, I can move the event loop into a separate thread [1, 2] - this should allow QGIS' event loop to continue running and accepting input etc. I am *guessing* that this can be made work. Question: Has someone around here actually tried it before? Best

Re: [QGIS-Developer] asyncio in plugins?

2021-03-23 Thread David Marteau
Hi, Asynchronous python code with asyncio assume that you have an ioloop running in a blocking way in your python code: that means that no other code (in the same thread) cannot run concurrently with your async tasks while your loop is running. David Le 23/03/2021 à 20:28, Sebastian M.

[QGIS-Developer] asyncio in plugins?

2021-03-23 Thread Sebastian M. Ernst
Hi all, has anyone made any (positive or negative) experiences with using `asyncio`-enabled [1] code in QGIS plugins? Best regards, Sebastian 1: https://docs.python.org/3/library/asyncio.html ___ QGIS-Developer mailing list