IceLib provides synchronous (blocking) and asynchronous (non-blocking) versions of most methods, especially those methods that make a server call. This convention allows the developer the convenience of choosing which programming model to use. It also allows him to switch back and forth between the two models where appropriate within the same application.

How Asynchronous Invocations Work

When an async method is invoked, the work is scheduled to be performed on a worker thread. Then, the async method returns back to the calling context so that the initial thread can continue without blocking. These async method flavors are frequently used when called from a UI thread so that the user experience is not degraded.

When an async method calls has completed, the completedCallback delegate is invoked on a thread appropriate to the application-model, such as the GUI thread in a UI application. The Error property of the System.ComponentModel..::..AsyncCompletedEventArgs-derived object passed to the delegate will contain any exceptions thrown while executing the asynchronous task. See the synchronous version of the method for more detailed error information.

Important
Watch-based properties are not available for use until the class instance's StartWatchingAsynccompletedCallback has been raised. See How Watches Work for more information.