Exemplo n.º 1
0
        static async Task <MongoDataDictionary <XDXRData> > Exec(XDXRReader reader)
        {
            //Func<XDXRReader,MongoDataDictionary<XDXRData>> action = delegate (XDXRReader rd)
            Func <MongoDataDictionary <XDXRData> > action = delegate()
            {
                MongoDataDictionary <XDXRData> list = reader.GetAllCodeDateSerialDataList <XDXRData>(true);
                LogableClass.ToLog("获取到除权除息数据", string.Format("股票数:{0};总条数:{1}", list.Count, list.Sum(p => p.Value.Count)));
                return(list);
            };

            return(await Task.Run(action));

            //return await Task.Run(action);
        }
Exemplo n.º 2
0
        public static MongoDataDictionary <XDXRData> getAllXDXRDataAsync(string DataType, List <string[]> codeGrp)
        {
            if (GlobalClass.TypeDataPoints[DataType].NeedLoadAllXDXR == 0)
            {
                return(null);
            }
            DateTime now = DateTime.Now;
            //MongoDataDictionary<XDXRData> ret = new MongoDataDictionary<XDXRData>();
            ////DateSerialCodeDataBuilder dcdb = new DateSerialCodeDataBuilder("CN_Stock_A",GlobalClass.TypeDataPoints["CN_Stock_A"].XDXRTable,codes);
            SecurityGrpReader <XDXRData> sgr = new SecurityGrpReader <XDXRData>();

            sgr.CheckEvent = (a, b, c, d, f) => { };
            MongoDataDictionary <XDXRData> data = sgr.GetResult(codeGrp, (a) =>
            {
                XDXRReader reader = new XDXRReader(GlobalClass.TypeDataPoints[DataType].DataType, GlobalClass.TypeDataPoints[DataType].XDXRTable, a);
                MongoDataDictionary <XDXRData> res = reader.GetAllCodeDateSerialDataList <XDXRData>(true);
                return(res);
            }, GlobalClass.TypeDataPoints[DataType].MaxThreadCnt, 1);

            return(data);
        }