Home » U++ Library support » U++ MT-multithreading and servers » Dealing with background tasks elegantly in a userinterface
Dealing with background tasks elegantly in a userinterface [message #58159] |
Fri, 04 March 2022 16:35  |
 |
Alboni
Messages: 216 Registered: January 2012 Location: Kajaani, Finland
|
Experienced Member |
|
|
Hello,
I wonder if there is an elegant way to execute tasks in the background. There are often MySql queries or http or rpc calls or other tasks that can potentially take more time than one can spend in a callback if you want a responsive userinterface.
How does one go about that in u++?
Some points:
Executing a query in the background and get a notification to the ui when it is done or failed and how much more time in between. Tasks over 5 seconds should be cancellable.
Do I have to open a MySqlSession for every query that is executed in the background?? Is this an "expensive" or slow thing to do or doesn't it matter.
Can I copy SqlSessions and use the copy in another thread concurrently with the original? DO I have to open it with credentials every time?
Cross thread communication with queues or pipes?
Using callbacks from threads?
About serializing tasks from other threads, is there an example for that?
I don't want to reinvent the wheel and get unreliable code. Done that too many times already.
I want the quick, easy and robust way. I'm missing the howto here, the overview. A reference is not enough.
(Yes, I've found Upp::Thread)
[Updated on: Fri, 04 March 2022 16:36] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sun May 11 17:56:17 CEST 2025
Total time taken to generate the page: 0.03085 seconds
|