D.Tkalcec (RTC)
|
|
« Reply #3 on: November 23, 2015, 08:32:52 AM » |
|
TRtcQuickJob dosn't have anything to do with Sessions and it does not bring anything "back". It is simply a way to run a "process" (a "task" or a "job") in the background, which is similar to using a TThread class from Delphi to create and run a thread. You can also use the good old TThread class from Delphi (or anything else that allows you to run a task in the background) to execute each background "process".
To get status updates to your Clients, each Client would need to poll the Server periodically (for example, using a remote function call) for a "Status Update" of its background "processes". And, ofcourse, you will need to keep track of your running "processes" (for example, in a shared list) on the Server, so you can access it from other threads to send it back to calling Client(s).
Anyway ... this is just one of way to run background tasks on the Server and provide status updates to Clients, but it doesn't solve other problems you will probably encounter in a production environment. For example, if you use a single machine for running hundreds (you are talking about 500 here) of processes parallel, with each running process slowing down all the other processes, your 5-minute tasks could end up running for hours each. Not to mention what would happen if users get annoyed and start the same task multiple times or terminate their Clients to place even more tasks into the processing queue on the Server. In short, you will need to serialize all these processes (maybe implement a "processing queue" and notify users about other running proceses and their current place in the queue) and use more machines.
Best Regards, Danijel Tkalcec
|