basicbot.py 文件源码

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

项目:bitcoin-arbitrage 作者: ucfyao 项目源码 文件源码
def notify_msg(self, type, price):
        import zmq
        try:
            context = zmq.Context()
            socket = context.socket(zmq.PUSH)

            socket.connect ("tcp://%s:%s" % (config.ZMQ_HOST, config.ZMQ_PORT))
            time.sleep(1)

            message = {'type':type, 'price':price}
            logging.info( "notify message %s", json.dumps(message))

            socket.send_string(json.dumps(message))
        except Exception as e:
            logging.warn("notify_msg Exception")
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号