From a future (java.util.concurrent.Future) is there any way to know if it’s process is currently running? Im trying to build a view in a web app which shows the status of certain processes and I can only get from the future if it is done or was cancelled.
From a future (java.util.concurrent.Future) is there any way to know if it’s process is
Share
That’s not the point of a
Future. The point is that it’s a promise of a future result, hence the name. It makes no guarantees about how or when it will be run. It could be run on the current thread, on a different thread, or potentially in a different process I suppose. As such, it doesn’t have any state beyond present or absent — which is more or less the whole point. If you want to monitor the progress of some thread, you have to work at that lower layer of abstraction.