def __init__(self, pipe_dict):
    self.buffers = defaultdict(bytes)
    self.loop = new_event_loop()
    for (src_fd, dest_fd) in pipe_dict.items():
        self.loop.add_reader(src_fd, partial(self._read, src_fd, dest_fd))
        self.loop.add_writer(dest_fd, partial(self._write, dest_fd))
    self.readers_to_writers = dict(pipe_dict)
    self.writers_to_readers = opposite_dict(pipe_dict)
def __init__(self, pipe_dict):
    self.buffers = defaultdict(bytes)
    self.loop = new_event_loop()
    for (src_fd, dest_fd) in pipe_dict.items():
        self.loop.add_reader(src_fd, partial(self._read, src_fd, dest_fd))
        self.loop.add_writer(dest_fd, partial(self._write, dest_fd))
    self.readers_to_writers = dict(pipe_dict)
    self.writers_to_readers = opposite_dict(pipe_dict)