MCPcopy Create free account
hub / github.com/wal-e/wal-e / pipe_wait

Function pipe_wait

wal_e/piper.py:125–140  ·  view source on GitHub ↗

Given an array of Popen objects returned by the pipe method, wait for all processes to terminate and return the array with their return values. Taken from http://www.enricozini.org/2009/debian/python-pipes/

(popens)

Source from the content-addressed store, hash-verified

123
124
125def pipe_wait(popens):
126 """
127 Given an array of Popen objects returned by the
128 pipe method, wait for all processes to terminate
129 and return the array with their return values.
130
131 Taken from http://www.enricozini.org/2009/debian/python-pipes/
132
133 """
134 # Avoid mutating the passed copy
135 popens = copy.copy(popens)
136 results = [0] * len(popens)
137 while popens:
138 last = popens.pop(-1)
139 results[len(popens)] = last.wait()
140 return results

Callers

nothing calls this directly

Calls 1

waitMethod · 0.80

Tested by

no test coverage detected