Silambarasan
Silambarasan

Reputation: 309

is there any method to find how many task remaing in ThreadPoolExecutor?

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

Answers (1)

Drona
Drona

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

Related Questions