errno() public method

get pcntl errno
public errno ( ) : integer
return integer
Exemplo n.º 1
0
 public function testWait()
 {
     $this->process_thread->start();
     $this->process_thread->wait();
     $this->assertEquals(0, $this->process_thread->exitCode());
     $this->assertEquals(0, $this->process_thread->errno());
     $this->process_runable->start();
     $this->process_runable->wait();
     $this->assertEquals(0, $this->process_runable->exitCode());
     $this->assertEquals(0, $this->process_runable->errno());
     $this->process_callback->start();
     $this->process_callback->wait();
     $this->assertEquals(0, $this->process_callback->exitCode());
     $this->assertEquals(0, $this->process_callback->errno());
 }
Exemplo n.º 2
0
 public function testWait()
 {
     $this->process_thread = new MyThread();
     $this->process_runnable = new \Jenner\SimpleFork\Process(new MyRunnable());
     $this->process_callback = new \Jenner\SimpleFork\Process(function () {
         for ($i = 0; $i < 3; $i++) {
             //                echo "callback pid:" . getmypid() . PHP_EOL;
         }
     });
     $this->process_thread->start();
     $this->process_thread->wait();
     $this->assertEquals(0, $this->process_thread->errno());
     $this->assertEquals($this->process_thread->errno(), 0);
     $this->assertEquals($this->process_thread->errmsg(), 'Success');
     $this->assertEquals($this->process_thread->isRunning(), false);
     $this->process_runnable->start();
     $this->process_runnable->wait();
     $this->assertEquals(0, $this->process_runnable->errno());
     $this->process_callback->start();
     $this->process_callback->wait();
     $this->assertEquals(0, $this->process_callback->errno());
 }