APM: fork on windows / long-running process and cgi
Sam Foster
austin.pm at sam-i-am.com
Thu Feb 8 13:37:11 PST 2007
so what is the skinny with fork on windows? No, not ever, yes with some
workarounds, yes with a particular distribution of perl for win32s?
I'm trying to put a web front-end on a build process - that may take a
while. Ideally my initial request would kick off the build, and later
requests would check on its status and finally pick up the output and
send it or a link to it back to the client.
I'm developing on and will ultimately be deploying to a windows xp box
with apache and activestate's perl.
So, it would seem that I should fork to kick the process off, send back
a "working..." message as a response and close stdout in the parent
process.
The child process goes on working, putting output from the build script
into a file.
The client would keep polling every few seconds to check status, and
grab and respond with the build script output, which will finally
include a link to where the user can download a zip of the output.
This is just for internal usage, and wont get high traffic. Concurrent
requests are possible, but honestly quite unlikely. In fact, depending
on the load on the server, the build usually finishes inside a minute so
I could probably keep it simple and just sit and wait for the response -
but I'd like to know what my options are. I do need input (config data)
from the user so I cant just schedule this and run it nightly or something.
Oh, and this is supposed to be a fun diversion from my real job, so if
I'm trying to make it too complicated that's why :)
thanks for any thoughts
Sam
More information about the Austin
mailing list