Page 1 of 1

wait until

Posted: Thu Feb 21, 2013 2:03 am
by Nakia
Hi,

what is the correct Syntax to wait for a handler to finish?

I have a handler (handler 1) that uses FTP to PUT and GET Files..
I also have another handler URL Progress that keeps track of the success of the transaction..

I want to be able to place a wait after any get/put transaction in handler 1 that waits for URL Progress to finish.
( this is to eliminate handler 1 working faster than the URL Progress handler)

Re: wait until

Posted: Thu Feb 21, 2013 2:30 am
by Simon
I'm guessing that handler 1 has a repeat loop that runs through lines in a variable?
If that is so then I'd re-think that scheme and use a "send" instead.
In your progress handler:
if the result = downloaded then
send "handler 1" to this cd

In handler 1 I'd use a local var that you update:
add 1 to tCount
put line tCount of myFTPList into downLoadThis

Much guessing here :D

Simon

Re: wait until

Posted: Thu Feb 21, 2013 2:40 am
by Nakia
Thanks Simon,

I will take a look into my Approach

Re: wait until

Posted: Fri Feb 22, 2013 10:07 am
by Nakia
FYI

Ended up finding wait for messages in the dictionary
which seems to work perfect..

From my observation it seems to halt the handler until the engine
Finishes processing any other handlers that are running at the same time..

Re: wait until

Posted: Fri Feb 22, 2013 9:32 pm
by Simon
Nice, I've never used "wait for messages".
Now I just have to find a reason to use it in one of my projects.

Simon
EDIT:
I re-discovered the dictionary entry that had me worried about your request:
"libURLftpUpload field "Upload Data",myURL
wait until the URLStatus of myURL is "uploaded" -- DON'T DO THIS"
Knew I had seen it before.