Asynchronous strategies

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
bradshaw1965
Posts: 98
Joined: March 14th, 2006, 2:16 pm
Location: Atlanta, GA
Contact:

hey folks,

With the new XML parsing abilities in AE CS3, I've been playing around with parsing web feeds and I've reached the point where I'd like to deal with some enclosures.

I've been following roughly the workflow of

1. set up a socket
2. feed a url to the socket
3. parse the xml and gather urls
4. feed the urls to system.callSystem('curl -O ' + photoUrl);

5. download and wait a bit

6. import and do stuff with the downloads

It's the wait a bit that I'm struggling a bit with. The downloads come down asynchronously and I have limited communication with the task on callSystem().

I guess I could launch a shell script, but I don't think I really have calllback capability. I could launch the task and wait in a while loop, set an internal timeout and if I don't accomplish my task, bail. Do all of this stuff server side and just check for completion at an interval.

Lots of possibilities. How are you folks handling asynchronous tasks with potientially leaky network communication and a scripting environment more set up for synchronous communication.
Dale Bradshaw
Technology Director | Primal Screen
creative-workflow-hacks.com
Atlanta, GA
Darkmoon_UK
Posts: 62
Joined: September 5th, 2006, 3:45 am
Location: Chiswick, London, UK
Contact:

Its a tricky one. I haven't been in the same situation just yet, though I am presently experiencing the joys of trying to get Java to talk to JavaScript via TCP.

I don't know what kind of output curl gives you on the commandline, but one idea would be to pipe that to a file which your AE script then continuously reads to get some kind of feedback on progress.

e.g.

Code: Select all

curl -O photourl >c:\curlProgress.txt
bradshaw1965
Posts: 98
Joined: March 14th, 2006, 2:16 pm
Location: Atlanta, GA
Contact:

Hey Darkmoon,

That's a good idea.

In general, I wish we had a user thread that was non-blocking. I'm struggling with both asynch and user feedback stuff. If there was a non-blocking event listener with a useful polling event we could marshal scripts a lot more efficently.

Off to do a feature request...

Dale
Dale Bradshaw
Technology Director | Primal Screen
creative-workflow-hacks.com
Atlanta, GA
Post Reply