Wait for multiple Async calls to finish (SL3)

2009-08-12 Thread Asheesh Soni
Any one knows a better / cleaner way to do this than: http://silverlight.net/forums/t/12437.aspx http://silverlight.net/forums/t/72631.aspx I have already dumped daisy-chaining of calls in favor of multiple async calls with a boolean flag for each. After calling all the async operations, I am

RE: Wait for multiple Async calls to finish (SL3)

2009-08-12 Thread Jordan Knight
I had a quick look at this the other day and when I compiled up the reactive dll, the classes were different that in the example: ObservableExtensions .DoAsync Didn't exist? I didn't really examine where I was going wrong in any great depth, so If you have any success I'd be interested

Re: Wait for multiple Async calls to finish (SL3)

2009-08-12 Thread Miguel Madero
Ali is going to give a talk on the Rx framework at the next SDDN Event in Sydney :) On Wed, Aug 12, 2009 at 7:48 PM, Jordan Knight jordan.kni...@readify.netwrote: I had a quick look at this the other day and when I compiled up the reactive dll, the classes were different that in the example:

Re: Wait for multiple Async calls to finish (SL3)

2009-08-12 Thread Miguel Madero
Attached is a brief example on how to do this using the WaitHandle in the IAsyncResult returned by each async method. The code is simple. In Silverlight I just do 10 service call that will add an item to a ListBox. I'll wait until all the service calls end to add another message to the list (this

Re: Wait for multiple Async calls to finish (SL3)

2009-08-12 Thread Miguel Madero
Asheesh, I'm comparing the different approaches, the one in StackOverFlow works well, this is what I don't like: * I think it's hard to work with multiple services using events instead of callbacks (as in my example), * They're using an AutoResetEvent, which we get for free if we use the

Re: Wait for multiple Async calls to finish (SL3)

2009-08-12 Thread Miguel Madero
Ross, You're totally right, altough isn't as fun, that'll definitely perfom better and should be the first option. I let myself go straight to VS to hack some code and completely overlooked this. On Wed, Aug 12, 2009 at 11:35 PM, Ross Jempson ross.jemp...@michaelhill.com.au wrote: Whilst

Re: Wait for multiple Async calls to finish (SL3)

2009-08-12 Thread Asheesh Soni
Thanks Miguel, Jake and others. You are right... I forgot to use BackgroundWorker... :p On Wed, Aug 12, 2009 at 11:04 PM, Miguel Madero m...@miguelmadero.com wrote: Asheesh, I'm comparing the different approaches, the one in StackOverFlow works well, this is what I don't like: * I think