protected function spawnIPCThread()
    {
        if (FileSystem::$supported) {
            eio_event_loop();
        }
        $thread = new IPC;
        $this->ipcthreads->push($thread);

        $this->callbacks->push(function ($self) use ($thread) {
            $thread->start();
            $pid = $thread->getPid();
            if ($pid < 0) {
                Daemon::$process->log('could not fork IPCThread');
            } elseif ($pid === 0) { // worker
                $this->log('Unexcepted execution return to outside of Thread->start()');
                exit;
            }
        });
        if (EventLoop::$instance) {
            EventLoop::$instance->interrupt();
        }
        return true;
    }
protected function spawnIPCThread()
    {
        if (FileSystem::$supported) {
            eio_event_loop();
        }
        $thread = new IPC;
        $this->ipcthreads->push($thread);

        $this->callbacks->push(function ($self) use ($thread) {
            $thread->start();
            $pid = $thread->getPid();
            if ($pid < 0) {
                Daemon::$process->log('could not fork IPCThread');
            } elseif ($pid === 0) { // worker
                $this->log('Unexcepted execution return to outside of Thread->start()');
                exit;
            }
        });
        if (EventLoop::$instance) {
            EventLoop::$instance->interrupt();
        }
        return true;
    }
protected function spawnIPCThread ( ) { if ( FileSystem :: $ supported ) { eio_event_loop ( ) ; } $ thread = new IPC ; $ this -> ipcthreads -> push ( $ thread ) ; $ this -> callbacks -> push ( function ( $ self ) use ( $ thread ) { $ thread -> start ( ) ; $ pid = $ thread -> getPid ( ) ; if ( $ pid < 0 ) { Daemon :: $ process -> log ( 'could not fork IPCThread' ) ; } elseif ( $ pid === 0 ) { // worker $ this -> log ( 'Unexcepted execution return to outside of Thread->start()' ) ; exit ; } } ) ; if ( EventLoop :: $ instance ) { EventLoop :: $ instance -> interrupt ( ) ; } return true ; }
Spawn IPC process
@param $n - integer - number of workers to spawn
@return boolean - success
Spawn IPC process