其他分享
首页 > 其他分享> > JDivideWork demo

JDivideWork demo

作者:互联网

    await divideWorkByTaskProvider.WhenAll(new DivideWorkOption
                {
                    Action = o =>
                    {
                        var item = o as DivideTaskInfo;
                        if (item == null) return;
                        for (var i = item.BeginIndex; i < item.EndIndex; i++)
                        {                          
                            var person = personInfo[(int)i];
                            //Do something.....
                            Do(person).Wait();
                        }
                    },
                    TaskNum = personInfo.Count < 10 ? 1 : 10,
                    Count = personInfo.Count
                });

 

标签:Count,Do,person,demo,personInfo,item,var,JDivideWork
来源: https://www.cnblogs.com/gaobing/p/15743520.html