I want to implement silverlight’s localmessaging using async await.
Lets say I created a method, ListenTask(), that returns a message wrapped in a Task using LocalMessageReceiver’s Listen method and Message Received event.
How can I use async await and process messages as I receive them?
Since you’re expecting many messages, not just one, this is likely a better fit for Reactive Extensions – Observable.FromEvent and then subscribe. Task is a good fit for a single future value, IObservable is a good fit for a ‘stream’ of future values.
With Rx 2.0, you can use await with observables if you wish.