waitRequest()) { try { $rsp = new Psr7\Response(); if ($req->getUri()->getPath() !== '/') { $worker->respond($rsp->withStatus(404)); continue; } $rsp->getBody()->write('Hello world!'); $rsp->getBody()->write(PHP_EOL); $rsp->getBody()->write((string)$counter++); $worker->respond($rsp); } catch (\Throwable $e) { $worker->getWorker()->error((string)$e); } }