def METHOD_NAME(reader, conn):
    """read_into_pipe"""
    for sample in reader():
        if sample is None:
            raise ValueError("sample has None!")
        conn.send(serialize_data(sample))
    conn.send(serialize_data(None))
    conn.close()