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
                });

 

上一篇:webserver 简单demo


下一篇:Jsp_Servlet小demo