XPSPL\Routine::add_signal PHP Method

add_signal() public method

Adds a signal to trigger in the loop.
public add_signal ( $signal ) : array
return array
    public function add_signal($signal)
    {
        if (!$this->_is_stale) {
            $this->_is_stale = false;
        }
        return $this->_signals[] = $signal;
    }

Usage Example

コード例 #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;
 }
All Usage Examples Of XPSPL\Routine::add_signal