}
class GetWorkAsync implements Runnable {
public void run() {
while(diabloMiner.getRunning()) {
ExecutionState executionState = null;
try {
executionState = getQueue.take();
} catch(InterruptedException e) {
continue;
}
if(executionState != null) {
WorkState workState = incomingQueue.poll();
if(workState == null) {
try {
workState = doGetWorkMessage(false);
} catch (IOException e) {
diabloMiner.error("Cannot connect to " + queryUrl.getHost() + ": " + e.getLocalizedMessage());
networkStateNext.addGetQueue(executionState);
try {
if(!noDelay)
Thread.sleep(250);
} catch(InterruptedException f) { }
continue;
}
}
workState.setExecutionState(executionState);
executionState.addIncomingQueue(workState);
}
}
}