Asynchronous strategies
Posted: November 6th, 2007, 2:29 pm
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.
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.