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
  • 63,838
  • 26
  • 184
  • 242
yaroslavTir
  • 701
  • 2
  • 9
  • 21

1 Answers1

5

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

flup
  • 26,894
  • 7
  • 50
  • 72