Async/await. = begininvoke endinvoke
Tasks = backgroundwork / threadpool

Events are still events you can't replace them with the new 4.0 threading.

Davy

Sent from my starfleet datapad.

On 3 mars 2013, at 05:18, David Kean <[email protected]> wrote:

  Why still using event based async, when you can use async/await in
Silverlight?



http://nuget.org/packages/Microsoft.Bcl.Async/1.0.14-rc





*From:* [email protected]
[mailto:[email protected]<[email protected]>]
*On Behalf Of *Greg Keogh
*Sent:* Friday, March 1, 2013 8:54 PM
*To:* ozDotNet
*Subject:* Async coding pattern



Folks, I have some skeleton code like this in a Silverlight app:



client.GetFooCompleted += (s, e) =>

{

    Trace("GetFoo result is {0}", e.Result);

};

client.GetFooAsync(rowId);



This works fine, but then I noticed that the completion handler code keeps
getting added on every call and the completion code runs 1, 2, 3, 4, etc
times.



Is there an elegant way of rejigging  this code to get the correct
one-call-one-completion behaviour.



Greg

Reply via email to