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

Added workersList() method into queue #891

Merged
merged 1 commit into from
Oct 26, 2015
Merged

Conversation

kolomiichenko
Copy link
Contributor

workersList() - a function returning the array of items currently being processed. This can be useful when it is not need push the new job to the queue if it's in process.

@sadovnychyi
Copy link

LGTM

👍

@aearly
Copy link
Collaborator

aearly commented Aug 24, 2015

Why do you need this? What problem does it solve?

@kolomiichenko
Copy link
Contributor Author

@aearly, in my situation, every task working for a few seconds (minutes), so I need to display progress queue. But in queue.tasks object I can't see tasks currently being processed. This code will solve this problem. Secondly, his can be useful when it is not need push the new job to the queue if it's in process.

@@ -863,8 +863,17 @@
function _next(q, tasks) {
return function(){
workers -= 1;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spliced?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@megawac, I do not know what I guided when giving name. Renamed to removed in force commit. 😄

aearly added a commit that referenced this pull request Oct 26, 2015
Added workersList() method into queue
@aearly aearly merged commit 7db25c7 into caolan:master Oct 26, 2015
@megawac
Copy link
Collaborator

megawac commented Dec 1, 2016

@aearly @kolomiichenko is this actually useful? I feel like you can get the same information on the progress by inspecting queue.length, queue.running and queue.concurrency

I want to better understand this use case, as this has become a bottleneck for queue

@aearly
Copy link
Collaborator

aearly commented Dec 4, 2016

I feel like the above comment explains it pretty well. Sometimes it is useful to know exactly which objects are being processed by the queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants