__init__.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:girder_worker 作者: girder 项目源码 文件源码
def read(self, n=65536):
        """
        Called when it is detected the input side of this connector is ready
        to read. Reads at most n bytes and writes them to the output ends of
        this connector. If no bytes could be read, the connector is closed.

        :param n The maximum number of bytes to read.
        :type n int
        :returns: The actual number of bytes read.
        """
        buf = self.input.read(n)

        if buf:
            self.output.write(buf)
            # TODO PushAdapter/Writers should return number of bytes actually
            # written.
            return len(buf)
        else:
            self.close()

        return 0
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号