public static async Task UpdateProxy() { ProxyParser proxyParser = new ProxyParser(); await Task.Factory.StartNew(() => { proxyParser.UpdateData(); }); }
public async Task <IList <IDrummerProxy> > GetProxiesAsync() { var proxies = new List <IDrummerProxy>(); if (!File.Exists(filePath)) { return(proxies); } var lines = File.ReadAllLines(filePath); if (lines == null || lines.Length < 1) { return(proxies); } await Task.Run(() => { var parser = new ProxyParser(lines); proxies = parser.Parse(); }); return(proxies); }