Re: AppleScript's Threadedness…
Re: AppleScript's Threadedness…
- Subject: Re: AppleScript's Threadedness…
- From: Simon Forster <email@hidden>
- Date: Thu, 20 Nov 2008 10:03:08 +0000
On 19 Nov 2008, at 23:01, has wrote:
Simon Forster wrote:
I've got a main AppleScript script which can be called by any
number of scripts - potentially simultaneously. In the main
AppleScript I plan to have a lightweight run handler which will add
the incoming request to a queue while other bits of the script may
be tied up elsewhere. Will this work or is AppleScript strictly a
one-task-at-a- time affair?
Use separate 'queue manager' and 'job runner' processes. Queue
manager fires up a job runner as needed and passes it the info
needed to process the job. When job runner completes, it sends a
message to the queue manager to let it know. If you run jobs
consecutively, you can do it all with standard AS applets; for
concurrent job processing, it gets a bit more fiddly so ask if you
need that.
This supposes a 'queue manager' constantly running in the background
no? As I'm pulling together a low rent hack for my own administrivia
needs and it's going to run on my much abused work machine, I'm after
something KISS. (And shortly after typing this I realised that I can
simply check to see if the queue manager's running. If it isn't start
it up and add to the queue. If it is, just add to the queue. Doh. Go
get 4th coffee.)
Initial testing suggests that I can have any number of 'job runner'
processes running quietly and that they'll queue themselves waiting
for the main application (FileMaker) to make itself available for the
next event. As long as the main application doesn't return half way
through a task (and experience suggests it wont), we'll be OK.
Obviously, suitable length timeouts will need to be set.
To be clear, I'm not worried about order of execution, just that
everything gets executed.
Suitably low rent me thinks.
ATB
Simon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden