public function testNewWorkerIncludes() { (new NativeReactor())->run(function ($reactor) { $dispatcher = new Dispatcher($reactor); $dispatcher->addStartTask(new TestAutoloaderStackable()); $dispatcher->setOption(Dispatcher::OPT_POOL_SIZE_MAX, 1); $promise = $dispatcher->call('Amp\\Thread\\Test\\AutoloadableClassFixture::test'); $promise->when(function ($error, $result) use($reactor) { $this->assertEquals(42, $result); $reactor->stop(); }); }); }