'Coroutine reading messages from the pool processes.'

def _make_process_result(self, hub):

    fileno_to_outq = self.fileno_to_outq
    on_state_change = self.on_state_change
    add_reader = hub.add_reader
    remove_reader = hub.remove_reader
    recv_message = self._recv_message
    def on_result_readable(fileno):
        try:
            fileno_to_outq[fileno]
        except KeyError:
            return remove_reader(fileno)
        it = recv_message(add_reader, fileno, on_state_change)
        try:
            next(it)
        except StopIteration:
            pass
        except (IOError, OSError, EOFError):
            remove_reader(fileno)
        else:
            add_reader(fileno, it)
    return on_result_readable
