I would like to run a QgsTask when I 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, I 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.