_broker.py 文件源码

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

项目:ave 作者: sonyxperiadev 项目源码 文件源码
def close_session(self, authkey):
        session  = self.sessions[authkey] # (Session, RemoteSession) tuple
        released = []

        # loop through share allocators
        for a in self.allocators:
            allocator = self.allocators[a]
            released.extend(self.allocators[a].close_session(session))

        try:
            session[LOCAL].terminate() # don't bother being nice.
        except OSError, e:
            if e.errno not in [errno.ECHILD, errno.ESRCH]:
                raise Exception('unhandled errno: %d' % e.errno)
        del self.sessions[authkey]
        # re-add released resources to the remote master broker if this broker
        # is configured to share
        if released and self.is_sharing():
            self.update_sharing()
        if not self.allocating:
            # handover in progress. shut down when no sessions with allocations
            # remain
            if not self.sessions:
                self.shutdown(Exit('broker restarted. please reconnect'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号