Search
English

A Node.js batch processing guide for developers used to Sidekiq and Selenium: default differences between BullMQ and Playwright(qiita.com)

startupxo Discuss

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.

Read source ↗

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.

Sign in to comment

Keyboard shortcuts

Choose a post with J and K or the arrow keys, then press Enter.

K ↑ / J ↓
Previous post / next post
Enter C
Open summary and comments for the selected post
O
Open the original link of the selected post
/
Search
?
Show this help
Tab
Move to the submit or comment button, then press Enter

Type normally in text fields. Tab and Enter are always available.