Showing posts with label Asynchronous Programming. Show all posts
Showing posts with label Asynchronous Programming. Show all posts

Saturday, August 11, 2012

Asynchronous Silverlight

Silverlight 2 web services still have thread affinity with the UI thread, it's just now there is some behind the scenes processing taking place. When a web service call is made, it is placed in a queue to be actioned by the UI thread. ...  Once the call completes the ...Completed handler is invoked on the same thread that the ...Async call was made. 
This is with regard to the proxy generated by the WCF service reference wizard.
http://www.codeproject.com/Articles/31018/Synchronous-Web-Service-Calls-with-Silverlight-Dis

Thursday, August 9, 2012

Working around GetListItemsAsync

First to step through References.cs comment out [System.Diagnostics.DebuggerStepThroughAttribute()] of ListsSoapClient. Tried making OnBeginGetListItems public and calling from custom class.cs without success. See this for possible workaround.
I could just chain call backs but IMO that is code smell (i.e. a leaky abstraction) because it "violate[s] implementation visibility by requiring consumers to know that they shouldn't expect to receive a return value [...]".

Wednesday, August 8, 2012

Asynchronous Events

(ProTip: If I initialize the event to an empty delegate{}, I don’t have to null-check the event before raising it.)  
http://www.headspring.com/blog/developer-deep-dive/using-waithandles-to-test-asynchronous-events/

Synchronous completion

If the synchronous completion of the call is detected in the AsyncCallback delegate, it is probable that the thread that initiated the asynchronous operation is the current thread.
http://msdn.microsoft.com/en-us/library/system.iasyncresult.completedsynchronously.aspx