#!/usr/bin/env php "text/plain; charset=utf-8" ], "Hello, World!"); }), new NullLogger); yield $server->start(); // Stop the server gracefully when SIGINT is received. // This is technically optional, but it is best to call Server::stop(). Amp\Loop::onSignal(SIGINT, function (string $watcherId) use ($server) { Amp\Loop::cancel($watcherId); yield $server->stop(); }); });