Beispiel #1
0
    def onGetPositionListRsp(rpcGetPositionListRsp):
        reqId = rpcGetPositionListRsp.commonRsp.reqId

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

        if rpcGetPositionListRsp.position:
            ClientTradeCacheService.storePositionList(
                rpcGetPositionListRsp.position)
 def onRpcPositionListRtn(rpcPositionListRtn):
     ClientTradeCacheService.storePositionList(rpcPositionListRtn.position)