I am using ScheduledThreadPoolExecutor:
threadPoolEx = new ScheduledThreadPoolExecutor(limit);
I want to know the number of tasks awaiting execution, or just to know if there are any tasks waiting (not necessarily the number).
How can I do that?
Thanks.
ScheduledThreadPoolExecutorhas agetQueue()method that you can use. You can query that for various bits of info on the waiting tasks (e.g.getQueue().getSize()).