PDA

View Full Version : asynchronous calls



HankFay
2014-01-30, 21:41
if I have, say, 20 tasks I want to run asynchronously, what are my options?

I know that timers run in their own process: so do I pop a timer up for each process?

Are there other options?

thanks,

Hank

barrymavin
2014-01-30, 23:21
What sort of tasks? Give me an example.

HankFay
2014-01-31, 08:51
What sort of tasks? Give me an example.

The reference USE CASE is: create a hash of the xml of the schema of each of 650 tables.

thanks,

Hank

barrymavin
2014-01-31, 09:12
Is that a once off operation?

i would not recommend doing that on a timer event as it will make the UI unresponsive.

on windows you can run background batch jobs. I have not yet made this available on Linux but can do in a point release. This is called lianjaRunScript which can be run as a background task (cron job on Linux).

alternatively you can use Lianja.spawnApp() and give it a Lianja/VFP script file name. That will run concurrently and not affect the UI thread.

HankFay
2014-01-31, 15:31
Lianja.spawnapp() looks like just the ticket! I thought I remembered there being something, but couldn't dredge it up from the remains of my memory. :)

thanks,

Hank