Example #1
0
 /// <summary>
 /// Closes <see cref="Connection"/> and any Chromium <see cref="Process"/> that was
 /// created by Puppeteer.
 /// </summary>
 public void Dispose()
 {
     try
     {
         CloseAsync().ConfigureAwait(false).GetAwaiter().GetResult();
     }
     finally
     {
         ScreenshotTaskQueue?.Dispose();
     }
 }
Example #2
0
 /// <summary>
 /// Closes <see cref="Connection"/> and any Chromium <see cref="Process"/> that was
 /// created by Puppeteer.
 /// </summary>
 /// <param name="disposing">Indicates whether disposal was initiated by <see cref="Dispose()"/> operation.</param>
 protected virtual void Dispose(bool disposing) => _ = CloseAsync()
                                                       .ContinueWith(
     _ => ScreenshotTaskQueue.DisposeAsync(),
     TaskScheduler.Default);