Brian Feeny
Brian Feeny

Reputation: 451

Queue.js: Can you access the number of items in a queue()?

I am processing many files through a queue() using defer(). I am wondering if from within one of my defer processes I an access the number of items in the queue? I did not see any accessors that would give me this, although the source of queue.js looks like there are attributes that may be accessible, I am just not sure how. Ideally I would be able to get the total number of items that started in the queue.

Thanks

Upvotes: 0

Views: 120

Answers (1)

Bergi
Bergi

Reputation: 665040

looks like there are attributes that may be accessible

No. Those are variables that are local to the queue() scope, they're not accessible from outside. There are no getters either, so you need to keep track of how many items you queued yourself.

be able to get the total number of items that started in the queue

Notice that a queue is always "started" as empty by calling queue(). You can add tasks to it at every time, so only you know yourself when "starting" is finished.

Upvotes: 1

Related Questions