Re: draining pipes simultaneously

2008-03-05 Thread Dmitry Teslenko
On Wed, Mar 5, 2008 at 3:39 PM, <[EMAIL PROTECTED]> wrote: > time.sleep() pauses ony the thread that executes it, not the > others. And queue objects can hold large amount of data (if you have > the RAM), > so unless your subprocess is outputting data very fast, you should not > have data los

Re: draining pipes simultaneously

2008-03-05 Thread bockman
> > Inserting delay in the beginning of the loop causes feeling of command > taking long to start and delay at the end of the loop may cause of > data loss when both thread became inactive during delay. time.sleep() pauses ony the thread that executes it, not the others. And queue objects can hol

Re: draining pipes simultaneously

2008-03-05 Thread Dmitry Teslenko
On Wed, Mar 5, 2008 at 1:34 PM, <[EMAIL PROTECTED]> wrote: > The Queue.get method by default is blocking. The documentation is not > 100% clear about that (maybe it should report > the full python definition of the function parameters, which makes > self-evident the default value) but if you d

Re: draining pipes simultaneously

2008-03-05 Thread bockman
On 5 Mar, 10:33, "Dmitry Teslenko" <[EMAIL PROTECTED]> wrote: > Hello! > Here's my implementation of a function that executes some command and > drains stdout/stderr invoking other functions for every line of > command output: > > def __execute2_drain_pipe(queue, pipe): >         for line in pipe:

draining pipes simultaneously

2008-03-05 Thread Dmitry Teslenko
Hello! Here's my implementation of a function that executes some command and drains stdout/stderr invoking other functions for every line of command output: def __execute2_drain_pipe(queue, pipe): for line in pipe: queue.put(line) return def execute2(command, out_f