send vs dispatch and continuously running processes

Kee Nethery kee at kagi.com
Thu Sep 30 09:55:58 EDT 2010


Will look at load and callback as a way to implement this kind of multitasking, thanks.
Kee


On Sep 30, 2010, at 6:42 AM, Mike Bonner wrote:

> If you're doing something like a repeat forever loop, somewhere in the loop
> you should have a wait with messages command so the script has breathing
> room to execute other things.
> IE:
> wait 10 milliseconds with messages
> 
> As for getting web urls, have you looked at the load command?
> 
> it will load a page into cache in the background, and you can designate a
> callback to handle it when the load is done.  Since this is a looping
> forever thing you'll need to make sure you unload the url after you process
> the results so that you always get a fresh result, and so that you don't
> fill your memory to the brim and bring your system to a standstill.
> 
> On Thu, Sep 30, 2010 at 7:27 AM, Kee Nethery <kee at kagi.com> wrote:
> 
>> Just want to confirm I understand these commands.
>> 
>> I tend to write applications that run continuously. They loop over and over
>> doing the same tasks and pretty much never get to a point to where they halt
>> waiting for user input. Thus for me the current script never finishes
>> executing.
>> 
>> The "send blah in X minutes" command appears to only execute once the
>> current script has completed, which in my case is never. So I assume I
>> should never use the "in X minutes" form and only ever use send as an
>> immediate command such that the current script halts and waits for it to
>> complete. Correct?
>> 
>> Dispatch looks to me like send except it makes it easier to include
>> parameters and does not include the delay, which I cannot use anyway.
>> Correct?
>> 
>> I was hoping that I could use Send or Dispatch to fire off a bunch of get
>> URL commands and then circle back to gather their results, a form of threads
>> or multi-tasking but from what I can see in the 4.5 docs, that is not how
>> those functions work. Is there a way in LiveCode to spawn a bunch of
>> processes to run in parallel and then to process their results as they get
>> returned?
>> 
>> I'm assuming the answers are: Yes, Yes, No. Just want to make sure I
>> understand them.
>> 
>> Kee Nethery_______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




-------------------------------------------------
I check email roughly 2 to 3 times per day. 
Kagi main office: +1 (510) 550-1336






More information about the Use-livecode mailing list