send vs dispatch and continuously running processes

Mike Bonner bonnmike at gmail.com
Thu Sep 30 09:42:09 EDT 2010


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
>



More information about the use-livecode mailing list