JAXLLoop::run PHP Method

run() public static method

public static run ( )
    public static function run()
    {
        if (!self::$is_running) {
            self::$is_running = true;
            self::$clock = new JAXLClock();
            while (self::$active_read_fds + self::$active_write_fds > 0) {
                self::select();
            }
            JAXLLogger::debug("no more active fd's to select");
            self::$is_running = false;
        }
    }

Usage Example

 public function start()
 {
     $this->parts = parse_url($this->url);
     $transport = $this->_transport();
     $ip = $this->_ip();
     $port = $this->_port();
     $socket_path = $transport . '://' . $ip . ':' . $port;
     if ($this->client->connect($socket_path)) {
         _debug("connection to {$this->url} established");
         // send request data
         $this->send_request();
         // start loop and wait for response
         JAXLLoop::run();
     } else {
         _debug("unable to open {$this->url}");
     }
 }
All Usage Examples Of JAXLLoop::run