2

I need to display all running tasks to the user. Every task is associated with a specific id. To execute tasks I use a ThreadPoolExecutor. Each thread has the same name as the id. So I just have to get list of all running and and waiting in queue threads. And then get there names and display them.

How can I do this?

Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
yaroslavTir
  • 711
  • 2
  • 10
  • 22

1 Answers1

5

Subclass the executor, override execute, beforeExecute and afterExecute to keep an administration of the scheduled and running tasks.

flup
  • 26,937
  • 7
  • 52
  • 74