Asynchronous widget-to-widget communication

May 21, 2010 at 3:48 PM

Hello -

First of all, nice work on the entire Dropthings project.  This is an awesome site.

I've been working with a local version of Dropthings where I'm extensively utilizing the widget-to-widget communication.  I've got a parent widget that does some processing and then when that processing is complete, it calls EventBroker.RaiseEvent and raises an event to all children widgets that have subscribed to it.  Once the children widgets accept the event from the parent widget, they call a web service to do some processing and eventually return the data back and refresh their content.

What I'm wondering is if there is a possibility to have the children widgets to process asynchronously instead of synchronously.  When I put a breakpoint in the foreach loop in RaiseEvent method in EventBrokerService.cs, the breakpoint will get hit once for each child widget, but only after the widget that came ahead if it in the loop has returned from the web service call.  I've done a little test where I've created a web service method in which I put a 10 second pause and then return from in to simulate a long running action.  Unfortunately, the loop will wait the entire 10 seconds before the next child widget can begin processing.  If I do this a couple of times, as you can imagine, it takes way too long to have the content refresh on the screen.

I'm curious if anyone has figured out an elegant solution around this or may have any ideas to try or if this is something that might be planned for a future release of Dropthings.