What is the best practice for asynchronously loading component data?

I don’t know what are the dangers.

I had apps using threads before the background tasks existed, and they were crippled with bugs. I couldn’t print, accesses to the database were failing, they were crashing, they were failing because killed half way, etc.

The fact that you have been lucky so far using using threads doesn’t make it the right way. Background tasks have been designed to do that job, to be monitored, to report the status, to last longer than the caller’s request and than the 30 second timeout, and to play nice with all the rest of Anvil infrastructure.

Said that, there may be simple cases where threads don’t pose any risks and background tasks would introduce useless overhead.

It’s sweet and unsafe. It’s ok to use it when you play around, but you need to know that you are opening that sweet door for yourself and for the rest of the world. Whatever you can do from the form, any hacker can do it.

I have the feeling that the 5 seconds are the sum of the server call plus all the round trips triggered because you play with row objects on the client side. Obviously I don’t know if it’s 4+1 or 1+4.

I don’t know what you are doing with the row objects on the client side, but when someone talks on the same post about both using row objects on the client side and performance problems, 9 times out of 10 that’s the problem.

Summary: I saw a couple of flags to be risen, and I did rise them :slight_smile: