Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): add RequestQueue.addRequestsBatched() that is non-blocking #1996

Merged
merged 3 commits into from Jul 19, 2023

Conversation

B4nan
Copy link
Member

@B4nan B4nan commented Jul 19, 2023

Previously, the BasicCrawler.addRequests() was the only place where we're handling adding the requests in non-blocking manner. This logic is now moved to the RequestQueue.addRequestsBatched() method.

This method now also correctly handles the requestsFromUrl option, meaning it can be also used with the BasicCrawler.addRequests() shortcut. Moreover, the batching is now configurable via batchSize and waitBetweenBatchesMillis options.

Closes #1995

Previously, the `BasicCrawler.addRequests()` was the only place where we're handling adding the requests
in non-blocking manner. This logic is now moved to the `RequestQueue.addRequestsBatched()` method.

This method now also correctly handles the `requestsFromUrl` option, meaning it can be also used with the
`BasicCrawler.addRequests()` shortcut. Moreover, the batching is now configurable via `batchSize` and
`waitBetweenBatchesMillis` options.

Closes #1995
@B4nan B4nan requested review from vladfrangu and barjin July 19, 2023 11:51
packages/core/src/storages/request_queue.ts Outdated Show resolved Hide resolved
@B4nan B4nan merged commit c85485d into master Jul 19, 2023
10 checks passed
@B4nan B4nan deleted the rq-batch-add-requests branch July 19, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support requestsFromUrl in BasicCrawler.addRequests()
2 participants