What is the best practice for asynchronously loading component data?

Using one timer per component is a very nice approach.
The main form doesn’t even know about it!

One way to optimize it would be to have only one timer on the main form that makes one call that returns the result of all the background tasks that are ready at once. I assume a round trip is required every time a component calls task_value = self.task1.get_return_value(), so, instead of having 10 timers pinging the server at the same time, you only have one.

This solution would decrease the number of round trips, but would make the components more complex. The component should expose attributes like need_to_be_checked and set_result.


Why did you decide to remove it from the parent? I would have set the interval to zero.

#self.timer_check_btask.interval=0
self.timer_check_btask.remove_from_parent()