private final void work_status(final GearmanPacket packet, final ServerClient client) { /* * This is sent to update the server (and any listening clients) * of the status of a running job. The client should send these * periodically for long running jobs to update the percentage * complete. The job server should store this information so a client * who issued a background command may retrieve it later with a * GET_STATUS request. * * Arguments: * - NULL byte terminated job handle. * - NULL byte terminated percent complete numerator. * - Percent complete denominator. */ final byte[] jobHandle = packet.getArgumentData(0); assert jobHandle != null; final ByteArray jobHandleBA = new ByteArray(jobHandle); final byte[] num = packet.getArgumentData(1); assert num != null; final byte[] den = packet.getArgumentData(2); assert den != null; final ServerJob job = ServerJobAbstract.getJob(jobHandleBA); if (job == null) { client.sendPacket(ServerStaticPackets.ERROR_JOB_NOT_FOUND, null /*TODO*/); } else { packet.setMagic(Magic.RES); job.setStatus(num, den); job.sendPacket(packet); } }