Skip to content

Instantly share code, notes, and snippets.

@karno
Created December 6, 2010 15:21
Show Gist options
  • Save karno/730420 to your computer and use it in GitHub Desktop.
Save karno/730420 to your computer and use it in GitHub Desktop.
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