1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 17:09:40 +01:00
amp/examples/event-loop/signals.php
2017-05-02 18:36:02 +02:00

16 lines
251 B
PHP

#!/usr/bin/env php
<?php
require __DIR__ . '/../../vendor/autoload.php';
use Amp\Loop;
print "Press Ctrl+C to exit..." . PHP_EOL;
Loop::onSignal(SIGINT, function () {
print "Caught SIGINT, exiting..." . PHP_EOL;
exit(0);
});
Loop::run();