Right now I'm using puppeteer (NodeJS library) to convert HTML into PDF documents. While this is "working", I'm porting over to Puppeteer-Sharp (C# library).
I've got everything working, but I'm somewhat concerned with running multiple browsers concurrently.
Say for example, I'm running the same code in two separate processes on the same machine:
// Magic function. Downloads Chrome to a specific directory for the process.
var browser = GetBrowser();
var page = await browser.NewPageAsync();
await page.GoToAsync("http://www.google.com");
var pdf = await page.PdfAsync();
My question:
Is there a potential concurrency issue here?
My (limited) understanding is that the library issues instructions to Chrome using websockets, and I'm not sure there's a potential that the browsers will "collide" with each other.
Essentially I'm asking if there's a potential that the PDF bytes received (via await page.PdfAsync();
) will be from the "other" browser.
If it's any consolation, the browsers are download and launched from specific directories per-process, so it's technically not the "same" instance of Chrome being launched twice (but it reality it is).