示例#1
0
 /**
  * Submit a job status request to determine the status of a background job.
  * You must wait for the status response by calling the wait method.
  *
  * @param string $handle The handle of the job to get status information for.
  * @return JobStatus
  */
 public function getJobStatus($handle)
 {
     $statusDetails = $this->createStatusDetails($handle);
     $status = new JobStatus($statusDetails);
     $this->statusList[] = $statusDetails;
     $packet = new Packet(PacketMagic::REQ, PacketType::GET_STATUS, [$handle]);
     $this->connection->writePacket($packet);
     return $status;
 }
示例#2
0
 private function sleep()
 {
     $packet = new Packet(PacketMagic::REQ, PacketType::PRE_SLEEP);
     $this->connection->writePacket($packet);
 }