bakerkj / weewx-purpleair

WeeWx Extension to pull data from the local interface of a Purple Air air quality sensor
GNU General Public License v2.0
17 stars 11 forks source link

Move sensor fetch from main thread to a separate thread #18

Closed bakerkj closed 3 years ago

bakerkj commented 3 years ago

Tom noted: your extension does a poll of the PA sensor in the main thread. This is generally not a good idea, as it will kill weewxd if the HTTP request fails. Better to set it up in a separate thread, and monitor a queue. See the wiki article multi-threaded service for a general idea of how to do this.