add_idle() 공개 메소드

Adds a new function to idle the engine.
public add_idle ( SIG_Routine $routine ) : void
$routine SIG_Routine
리턴 void
예제 #1
0
파일: sig_awake.php 프로젝트: prggmr/xpspl
 /**
  * Runs the routine.
  *
  * This checks if the appriorate amount of time has passed and emits the 
  * awake signal if so.
  * 
  * @return  boolean
  */
 public function routine(\XPSPL\Routine $routine = null)
 {
     if ($this->get_idle()->has_time_passed()) {
         $routine->add_signal($this);
         $this->get_idle()->set_time($this->_time);
     }
     $routine->add_idle($this);
     return true;
 }
예제 #2
0
파일: sig_cron.php 프로젝트: prggmr/xpspl
 /**
  * Determines when the time signal should fire, otherwise returning
  * the processor to idle until it will.
  * 
  * @return  integer
  */
 public function routine(\XPSPL\Routine $routine = null)
 {
     if ($this->get_idle()->has_time_passed()) {
         $this->_next_run = $this->_cron->getNextRunDate()->getTimestamp();
         $routine->add_signal($this);
     }
     $this->get_idle()->set_time($this->_next_run - time());
     $routine->add_idle($this);
     return true;
 }
예제 #3
0
파일: socket.php 프로젝트: prggmr/xpspl
 /**
  * Registers the idle process.
  *
  * @return  void
  */
 public function routine(\XPSPL\Routine $routine)
 {
     if (null === $this->_connection) {
         $this->_connect();
         $routine->add_signal(new SIG_Connect($this->_connection));
     }
     $routine->add_idle($this);
 }
예제 #4
0
파일: routine.php 프로젝트: prggmr/xpspl
 /**
  * Run the idle function.
  */
 public function routine(\XPSPL\Routine $routine)
 {
     // TODO - Add function to fetch lowest idle time
     $routine->add_idle($this);
 }
예제 #5
0
파일: sig_upload.php 프로젝트: prggmr/xpspl
 public function routine(\XPSPL\Routine $routine)
 {
     if (count($this->_files) > 0 || count($this->_uploading) > 0) {
         $routine->add_idle($this);
     }
 }