Java : Is there a way to add a listener to an Executor?
I have a collection with Futures which I try to monitorize , as to update some GUI statuses. Currently I am checking in a background thread if there are differences in the submitted/completed tasks, but I am doing this in a while(true){} block and I do not like this approach.
Java : Is there a way to add a listener to an Executor ?
Share
Unfortunately, there is no way to do that.
Instead, use Google’s
ListenableFuture<V>interface.Alternatively, use a language with better async support, such as C# and the TPL.