Ko\ProcessManager::fork PHP Method

fork() public method

Forks the currently running process.
public fork ( callable $callable ) : ko\Process
$callable callable Callable with prototype like function(Ko\Process $p) }
return ko\Process
    public function fork(callable $callable)
    {
        return $this->internalFork($this->createProcess($callable));
    }

Usage Example

コード例 #1
0
ファイル: Application.php プロジェクト: umpirsky/ko-worker
 protected function runChilds()
 {
     $count = $this->getWorkerCount();
     for ($i = 0; $i < $count; $i++) {
         $closure = $this->getChildCallable();
         if ($this->isForkMode()) {
             $this->processManager->fork($closure);
         } else {
             $this->processManager->spawn($closure);
         }
     }
 }
All Usage Examples Of Ko\ProcessManager::fork