On Thursday, June 23, 2016 at 10:50:10 AM UTC+12, Ke Wang wrote:
> Raises EOFError if there is nothing left to receive and the other end was
> closed.
Does the parent process have to close the sending end of the pipe as well?
Otherwise the receiver never gets EOF as long as one process still has
import multiprocessing as mp
def send(conn):
"""send obj to pipe"""
for i in range(10):
conn.send(i)
print("send:", i)
conn.close()
def transform(func, conn):
"""receive input from pipe, transform it"""
try:
while True:
i = conn.recv()