Esempio n. 1
0
        internal void Enqueue(IBrowserContent request, MovieBuilder builder)
        {
            IBrowser browser;

            if (runningPages.Count < MaxRunningPages && availableWorkers.TryDequeue(out browser))
            {
                try
                {
                    lock (this)
                    {
                        runningPages.Add(new RunningPage(request.Uri, builder, browser));
                    }
                    browser.Navigate(request.Uri).ContinueWith(task => PageLoaded(new BrowserPageInspectSubscription(this, request, browser, builder)));
                    return;
                }
                catch (Exception ex)
                {
                    logger.Error(string.Format("Unable to navigate to the page {0}", request.Uri), ex);
                    availableWorkers.Enqueue(browser);
                    throw;
                }
            }

            logger.Info("An address has been enqueued: " + request.Uri);
            enqueuedPages.Enqueue(new Page(request, builder));
        }
Esempio n. 2
0
 internal BrowserPageInspectSubscription(MovieBuilderPool pool, IBrowserContent request, IBrowser browser, MovieBuilder builder)
 {
     this.builder = builder;
     this.request = request;
     this.browser = browser;
     this.pool    = pool;
 }
Esempio n. 3
0
 public PendingBuildAsyncOperation(MovieBuilder builder)
 {
     this.builder = builder;
     Interlocked.Increment(ref builder.waitingEvents);
 }
Esempio n. 4
0
        public MovieBuilder CreateBuilder(BasicMovieInfo movieInfo)
        {
            var builder = new MovieBuilder(this, movieInfo);

            return(builder);
        }
Esempio n. 5
0
 public RunningPage(Uri uri, MovieBuilder builder, IBrowser browser)
 {
     Uri     = uri;
     Builder = builder;
     Browser = browser;
 }
Esempio n. 6
0
 public Page(IBrowserContent request, MovieBuilder builder)
 {
     Request = request;
     Builder = builder;
 }