Created
December 6, 2010 15:21
-
-
Save karno/730420 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Status_Received(IEnumerable<Tweet> tweets) | |
{ | |
var act = new Action(()=>{ | |
foreach(var t in tweets) | |
{ | |
Dispatcher.BeginInvoke(()=>SomeMethod(t)); | |
}}); | |
act.BeginInvoke((iar)=>act.EndInvoke(iar), null); | |
} | |
void SomeMethod(Tweet t) | |
{ | |
Thread.Sleep(10000); // 時間のかかる処理 | |
Console.WriteLine(t); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment