1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 17:37:50 +01:00
amp/examples/event-loop/signals.php

16 lines
251 B
PHP
Raw Normal View History

2017-05-02 13:32:58 +02:00
#!/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();