pipes

qget(queue, *args, **kwargs)[source]

Wrapper that calls the get() method of a queue, catching EINTR interrupts and retrying. Recent versions of Python have this built in, but with earlier versions you can end up having processes die while waiting on queue output because an EINTR has received (which isn’t necessarily a problem).

Parameters:
  • queue
  • args – args to pass to queue’s get()
  • kwargs – kwargs to pass to queue’s get()
Returns:

class OutputQueue(out)[source]

Bases: object

Direct a readable output (e.g. pipe from a subprocess) to a queue. Returns the queue. Output is added to the queue one line at a time. To perform a non-blocking read call get_nowait() or get(timeout=T)

get_nowait()[source]
get(timeout=None)[source]
get_available()[source]

Don’t block. Just return everything that’s available in the queue.