__init__.py 文件源码

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

项目:piwheels 作者: bennuttall 项目源码 文件源码
def do_send(self, filename):
        """
        If a build succeeds and generates files (detailed in a "BUILT"
        message), the master will reply with "SEND" *filename* indicating we
        should transfer the specified file (this is done on a separate socket
        with a different protocol; see :meth:`builder.PiWheelsPackage.transfer`
        for more details). Once the transfers concludes, reply to the master
        with "SENT".
        """
        assert self.slave_id is not None, 'Send before hello'
        assert self.builder, 'Send before build / after failed build'
        assert self.builder.status, 'Send after failed build'
        pkg = [f for f in self.builder.files if f.filename == filename][0]
        self.logger.info('Sending %s to master on localhost', pkg.filename)
        ctx = zmq.Context.instance()
        queue = ctx.socket(zmq.DEALER)
        queue.ipv6 = True
        queue.hwm = 10
        queue.connect('tcp://{master}:5556'.format(master=self.config.master))
        try:
            pkg.transfer(queue, self.slave_id)
        finally:
            queue.close()
        return ['SENT']
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号