public override async Task Execute() { while (true) { await SystemCore.NextFrame(); Console.WriteLine(GetThreadId() + "Start Down"); Fiber fiber = new Fiber(); fiber.SetAction(Down); fiber.Start(); string baidu = await DownHtml(fiber, "http://www.baidu.com"); string QQ = await DownHtml(fiber, "http://www.QQ.com"); Console.WriteLine(GetThreadId() + "Baidu HTML LENGTH:" + baidu.Length); Console.WriteLine(GetThreadId() + "QQ HTML LENGTH:" + QQ.Length); Console.WriteLine(GetThreadId() + "Down Close"); await Task.Delay(10000); } }
public override async Task Execute() { Console.WriteLine("My Name is " + Name); while (true) { await SystemCore.NextFrame(); testcab.SetSync <string>(Name); } }
public override async Task Execute() { while (true) { await SystemCore.NextFrame(); await Task.Delay(1000); Console.WriteLine(GetThreadId() + DateTime.Now); } }
public override async Task Execute() { while (true) { await SystemCore.NextFrame(); string a = await GetArgs(); Console.WriteLine(GetThreadId() + "Id:{0}", a); await Task.Delay(2000); } }
public override async Task Execute() { while (true) { await SystemCore.NextFrame(); WebClient client = new WebClient(); byte[] a = await client.DownloadDataTaskAsync("http://www.baidu.com"); Console.WriteLine(a.Length); await Task.Delay(10000); } }