Beispiel #1
0
        public static async Task <T[]> WhenAll <T>(IEnumerable <Task <T> > tasks)
        {
            var t = tasks as Task <T>[] ?? tasks.ToArray();
            await Tasky.WhenAll(t);

            return(t.Select(tt => tt.Result).ToArray());
        }
Beispiel #2
0
        public static void Cache()
        {
            _cacheprogress?.Wait();

            _cacheprogress = Tasky.Run(() => {
                var l = new List <Task>();
                foreach (var dist in DistributionManager.GetDistributers(false))
                {
                    l.Add(Tasky.Run(() => {
                        foreach (var d in dist.Distributables())
                        {
                            _randlocdb.Add(d);
                        }
                    }));
                }
                Tasky.WhenAll(l.ToArray()).Wait();
                _cacheprogress = null;
            });
        }
Beispiel #3
0
 public static Task WhenAll(IEnumerable <Task> tasks)
 {
     return(Tasky.WhenAll(tasks));
 }
Beispiel #4
0
 public static Task WhenAll(params Task[] tasks)
 {
     return(Tasky.WhenAll(tasks));
 }
Beispiel #5
0
        public static Task <T[]> WhenAll <T>(IEnumerable <Task <T> > tasks)
        {
            var t = tasks as Task <T>[] ?? tasks.ToArray();

            return(Tasky.WhenAll(t).ContinueWith(tt => t.Select(tas => tas.Result).ToArray()));
        }