def __call__(self, fd, events):
            if not (events & ioloop.IOLoop.READ):
                if events == ioloop.IOLoop.ERROR:
                    self.redirector.remove_fd(fd)
                return
            try:
                data = os.read(fd, self.redirector.buffer)
                if len(data) == 0:
                    self.redirector.remove_fd(fd)
                else:
                    datamap = {'data': data, 'pid': self.process.pid,
                               'name': self.name}
                    self.redirector.redirect[self.name](datamap)
            except __HOLE__ as ex:
                if ex.args[0] != errno.EAGAIN:
                    raise
                try:
                    sys.exc_clear()
                except Exception:
                    pass
dataset/ETHPy150Open circus-tent/circus/circus/stream/redirector.py/Redirector.Handler.__call__