Handling java.util.concurrent.Future with null result
-
30-10-2019 - |
Question
If I submit task, and futureTask.get() returns null, I would like to process what I sent in the Callable object another way. When debugging, I can see that my Future has a private final member called "sync". "sync" contains my callable, which has the original data that I sent in the Callable. Unfortunately, I can't get to it.
In pseudocode...
Callable callable = new Callable(myData);
Future future = executor.submit(callable);
if (future.get() == null)
{
//what I would like to have if the "sync" member was available..
String alreadySubmittedData = future.sync.callable.myData;
}
It seems like there should be a way to do this? Thanks.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow