mainloop.py 文件源码

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

项目:supvisors 作者: julien6387 项目源码 文件源码
def check_events(self, subscriber, socks):
        """ Forward external Supervisor events to main thread. """
        if subscriber.socket in socks and \
            socks[subscriber.socket] == zmq.POLLIN:
            try:
                message = subscriber.receive()
            except:
                print >> stderr, '[ERROR] failed to get data from subscriber'
            else:
                # The events received are not processed directly in this thread
                # because it would conflict with the processing in the
                # Supervisor thread, as they use the same data.
                # That's why a RemoteCommunicationEvent is used to push the
                # event in the Supervisor thread.
                self.send_remote_comm_event(
                    RemoteCommEvents.SUPVISORS_EVENT,
                    json.dumps(message))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号