I'm creating a simple GUI application using PyQt5 where I request some data from an API which is then used to populate various controls of the UI.
The examples I was following about worker threads in PyQt all seem to sub-class QThread
and then do their business logic in the overridden run()
method. This works fine but I want to execute different API calls at different times using a worker.
So my question is: do I need to create a specific worker thread for every operation I wish to do or is there a way of having a single thread class that I can use to carry out different operations at different times and therefore avoid the overhead of creating different thread sub-classes?