Calling a function and waiting


#1

What is the best practice to call a function which loads the db and tell it to wait for it to execute before my function continues? I think my load is taking longer than expected an my function is processing without waiting for completion of the data loading.

Robb


#2

I had a similar issue. I suggest making it asynchronous, i.e. set a flag and have a callback mechanism to fire when the db has finished loading. How do we know when its done? maybe start by passing the number of records and check when all of them have loaded.

Doing it with a timer will never be accurate based on size of table, network conditions etc.


#3

How are you loading the DB?

If you’re using SQLImport, it has an argument which is the function to call when complete.

George Henne
NS BASIC Corporation
http://www.nsbasic.com


#4

I ended up using a locking implementation which allows multiple processes to run an when they all finished execute a callback.

Thank you,
Robb


#5

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.