public function spawn(callable $callable)
{
return $this->internalSpawn($this->createProcess($callable));
}
public function testReSpawnedProcessHasPersistSharedMemorySegment() { $process = $this->manager->spawn(function (Process $p) { $sm = $p->getSharedMemory(); $sm['spawnCount'] += 1; $exitCode = $sm['spawnCount'] == 1 ? -1 : 0; exit($exitCode); }); $this->manager->wait(); $this->assertEquals(2, $process->getSharedMemory()['spawnCount']); }