I would like to run a QgsTask when iI push a button in a Qgis plugin (3.10). My task is a subclass similar to this example
In the main class of my plugin, iI have added this (connected to the button that works) :
def myBtnAction(self) :
from .my_task import MyTask
task = MyTask('run my task', 20)
QgsApplication.taskManager().addTask(task)
The task is never executed.