Why doesn't complete flag get set unless you call GearmanJob.get method?
I am using the following code snippet:
Future<
while( !result.isDone() ) {
log.info("Not Done");
Thread.
}
GearmanJobResult jobResult = result.get();
The isComplete flag never gets set unless you call the get method, so this code never ends.
If a remove the while loop everything is OK.
I would like to use the isDone method as a polling method so I can go through a list of Future objects,
and see if they are completed.
What is the right way to handle multiple Future<GJR> objects? I tried to use multithreading with thread pools handling the future objects but that had problems whith jobs not completing. Is GearmanClient thread safe? Should I instead use GearmanClient/
Thanks in advance
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Dragan Vujovic
- Solved:
- Last query:
- Last reply: