Esempio n. 1
0
    def onGetOrderListRsp(rpcGetOrderListRsp):
        reqId = rpcGetOrderListRsp.commonRsp.reqId

        RpcClientRspHandler.__waitReqIdSetLock.acquire()
        RpcClientRspHandler.__rpcGetOrderListRspDictLock.acquire()
        try:
            if reqId in RpcClientRspHandler.__waitReqIdSet:
                RpcClientRspHandler.__rpcGetOrderListRspDict[
                    reqId] = rpcGetOrderListRsp
            else:
                logger.info("直接丢弃的回报,请求ID:%s", reqId)
        finally:
            RpcClientRspHandler.__waitReqIdSetLock.release()
            RpcClientRspHandler.__rpcGetOrderListRspDictLock.release()

        if rpcGetOrderListRsp.order:
            ClientTradeCacheService.storeOrderList(rpcGetOrderListRsp.order)
 def onRpcOrderListRtn(rpcOrderListRtn):
     ClientTradeCacheService.storeOrderList(rpcOrderListRtn.order)
     for order in rpcOrderListRtn.order:
         StrategyEngine.onOrder(order)