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

Check each batch results before continue #154

Open
ThanosDi opened this issue Jul 22, 2021 · 1 comment
Open

Check each batch results before continue #154

ThanosDi opened this issue Jul 22, 2021 · 1 comment

Comments

@ThanosDi
Copy link

Is there a way to check the batch results (based on concurrency) to determine if the queue should continue?

For example I want to check 500 urls with concurrency 10 but I'd like to know each batch result to understand if I should keep going or not.

@filippofilip95
Copy link

filippofilip95 commented Sep 8, 2021

Maybe you could store you results to array and check if it meets conditions to stop the queue.

const results = [];

queue.on('completed', (result) => {
  results.push(result);

  if (shouldCancel(results)) {
    queue.pause();
  }
});

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

No branches or pull requests

2 participants