Feature request #21391
QgsProject Notify/Listen
Status: | Open | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Data Provider/PostGIS | ||
Pull Request or Patch supplied: | No | Resolution: | |
Easy fix?: | No | Copied to github as #: | 29208 |
Description
At the moment, the only way to "LISTEN" to postgres database is through QgsProvider or QgsMapLayer. This inevitably needs to target a layer. It would be nice if the project itself (QgsProject) could be set up to listen to postgres and its respective signals.
The reason behind is that I have several plugins with different tables (task allocation, chat, notifications) with loaded layers (with set notify, refresh and repaintRequested) and signals, that leaves me with 3 permanent established connections to postgres.
- Using Python to "LISTEN" crashes as stated here: https://gis.stackexchange.com/questions/305219/qgis-3-python-plugin-psycopg2-postgres-notify-listen-live-connection
The only solution I can think of at the moment is to create a single table that stores my notify signals in postgres and use it to spread the signals in Qgis. However, this is a dodgy solution, so having the project to listen would open up a new world of possibilities, in my opinion.
--------------
Also, the class QgsMapLayer contains 3 typos("Nofify"? -> setRefreshOnNofifyMessage, mIsRefreshOnNofifyEnabled, mRefreshOnNofifyMessage
Many thanks.