Asynchronous upload via post?

Dave Cragg dave.cragg at lacscentre.co.uk
Wed Jun 13 18:19:55 EDT 2007


On 13 Jun 2007, at 19:52, Stephen Barncard wrote:
> so if one trys to do a blocking thing, say, in the bg script, then  
> any handler in that script is halted?

Sorry. I was unclear. Only the *handler* the blocking call was made  
in blocks.

The following may illustrate how blocking calls in libUrl work (needs  
button and field). Normally "send .. in 0 milliseconds" will only  
invoke the called handler after the currently running handler has  
completed. But it will get invoked earlier if there is a "wait ...  
with messages" or equivalent somewhere in the running handler.

local sHold

on mouseUp
   put false into sHold
   put empty into field 1
    handlerA
end mouseUp

on handlerA
   send handlerB to me in 0 milliseconds
    put "A1" & return after field 1
    ### next line is equivalent to a libUrl blocking call
   handlerC
   ## this handler blocks here
   ## but handlerB will run
   put "A2" & return after field 1
end handlerA

on handlerB
   put "B" & return after field 1
   put true into sHold
end handlerB

on handlerC
   wait while sHold is false with messages
end handlerC



Cheers
Dave



More information about the use-livecode mailing list