On 11/04/11 05:31, Lutz Paelike wrote:
>> If I decide on vacationing in the sixth circle of hell, I can
> follow up with the WIN32 equivalent code.
>
> Thanks for your example script.
> If i use perl i will join you on your vacation ;)
Ha, I guess I should have asked you if you were
using python.
> I will stick to python, these things are nicely encapsuled in the =
> subprocess module.
That's interesting; I guess you could do a non-blocking read
on the subprocess.Popen() pipe, in which case that would probably
work OK, because then your read loop wouldn't hang if the program
stopped outputting data, so it can detect a timeout.
If you can, post a simplified version of what you come up with.
If I get a chance, I'll try to post some code that does what
I describe above.
I think the above technique could have been done in perl,
but I didn't investigate non-blocking reads, as I knew waitpid()
would work.. but that might be easier. It also gives you the option
to parse the output of the render while it runs, so you can catch
errors as they happen.
Be aware when you 'kill' the render, the renderer MIGHT have
started children, so you want to use a process group to be sure
to kill not only the immediate child, but all its children too.
For sure 'rush -fail $os.environ["RUSH_FRAME"]' would clean all
this up for you, killing your own script as well as the render
and any of its children. So if you're worried about using kill
correctly, you could use that instead. (Just be sure that's the
/last/ thing you do, as your script will probably be unceremoniously
killed within the next fraction of a second.
--
Greg Ercolano, erco@(email surpressed)
Seriss Corporation
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)ext.23
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)
|