A Node.js batch processing guide for developers used to Sidekiq and Selenium: default differences between BullMQ and Playwright(qiita.com)
Writing language: KoreanRead in the original language
Plain summary
- Explains how to build jobs that run automatically in the background, separate from user actions (batch processing), in Node.js. It combines BullMQ, which queues jobs, with Playwright, which automates browsers, and they correspond to Sidekiq and Selenium in Rails respectively.
- The differences the author points out are as follows. BullMQ's default concurrency is 1, and the value applies per worker. Retries require specifying attempts, and finished jobs also stay in Redis by default, so cleanup settings are needed.
- Playwright automatically waits until an element becomes actionable before clicking. The author explains that creating a separate BrowserContext for each job keeps login states from mixing.
- On shutdown, worker.close() finishes the jobs in progress and then stops. When the author tested it directly, SIGTERM was not passed to the worker when it was launched with npm run or npx. The author says the examples were confirmed to work with BullMQ 6.7 and Playwright 1.65.
Found on
Qiita ↗ / Published by source
Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.