This project is read-only.

Are executions inside GetVideoUri asynchronous?

Apr 2, 2013 at 8:11 PM
            YouTube.GetVideoUri(videoID, YouTubeQuality.Quality720P, (entry, excep) =>
            {
                if (excep != null)
                {
                           //Exception
                }
                else
                {
                    if (entry != null)
                    {
                        Debug.WriteLine(entry.Uri.AbsoluteUri);
                        //some code here
                        //__statement-A__
                    }
                }
            });

            // Some lines of code here
            // __statement-B__
Will statement-B necessarily execute only after statement-A? Or is it possible that statement-B executes before statement-A?

For me currently it looks like sometimes statement-B executes even before statement-A. Is that possible?
Apr 2, 2013 at 8:59 PM
Edited Apr 4, 2013 at 9:12 AM
No. If there is an exception while creating the request it may be called in the same thread... but you can force a delayed execution with

(entry, excep) => Deployment.Current.Dispatcher.BeginInvoke(delegate {...})

but everything will run on UI thread...