Reputation: 309
I'm using ThreadPoolExecutor for some task. I need to know whether ThreadPoolExecutor has and method to find how many task remaining in assigned queue. is it possible? depends upon the return value i'll assign task again ,I don't know how many task assigned early.
Upvotes: 0
Views: 116
Reputation: 7234
Use the ThreadPoolExecutor's getTaskCount() method to get the tasks in the queue. This is an approximate value as tasks coulld be consumed dynamically and this value can change.
Upvotes: 1