示例#1
0
 /**
  * Run some code in a thread.
  *
  * @param callable $func The function to execute
  * @param mixed $args The arguments to pass to the function
  *
  * @return int The pid of the thread created to execute this code
  */
 public function call(callable $func, ...$args) : int
 {
     $pid = $this->adapter->call($func, ...$args);
     $this->threads[$pid] = $pid;
     return $pid;
 }