} } // END IF } // END IF if ($APP['ms']->kind != "no-messaging" && !$messaging_complete) { // WAIT FOR MESSAGE QUEUE RESPONSE $message = $new_job_id->receive("replyfrom_" . $selected_job_server_name); $all_messages .= $message . "<br/>\n"; if (($message . "" == "NULL" || strlen($message . "") == 0) && $cnt < 15) { sleep(1); continue; } $message_xml = xmlToArray(simplexml_load_string($message)); $collected_job_id = new job_id_user(); $collected_job_id->fromobjectxml($message_xml); if ($collected_job_id->id == $id_submitted_job) { $new_job_id->fromobjectxml($message_xml); $messaging_complete = True; } else { $all_messages .= "received a wrong message: " . htmlspecialchars($message); // we collected a message from anoth/er job - re-post the message to the queue so we don't end up stealing other jobs' responses $collected_job_id->send("replyfrom_" . $selected_job_server_name, $message); } } else { $new_job_id->get_from_hashrange($u->id_user, $new_job_id->id); } if ($new_job_id->id_status != 'running' && $new_job_id->id_status != 'new' && $new_job_id->id_status != 'paused') { // JOB IS DONE break; } else {