manager.py 文件源码

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

项目:arbitrage 作者: altfund 项目源码 文件源码
def start(self, config: dict):
        """Start the arbiter worker process"""
        with self.lock:
            if self.arbiter and not self.arbiter_stop_flag.value:
                msg = 'Failed to start. Arbiter process already running.'
                raise ServiceException(msg)

            if self.arbiter_process and self.arbiter_process.is_alive():
                LOG.info('Arbiter process is still alive. Terminating...')
                self.arbiter_process.terminate()

            self.arbiter_stop_flag = Value('b', False)
            self.config = Configuration().update(config)
            self.arbiter = Arbiter(self.config)
            self.arbiter_process = Process(target=self._loop,
                                           args=(self.arbiter,
                                                 self.arbiter_stop_flag))
            self.arbiter_process.daemon = True
            self.arbiter_process.start()
            self.start_time = time.time()
            LOG.info('Arbiter process was started')
            return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号