Skip to content

Instantly share code, notes, and snippets.

@clue
Created October 13, 2017 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clue/c00148c614854ea7abae74bd1e8fb7f3 to your computer and use it in GitHub Desktop.
Save clue/c00148c614854ea7abae74bd1e8fb7f3 to your computer and use it in GitHub Desktop.
<?php
$loop = React\EventLoop\Factory::create();
$loop->addSignal(SIGINT, function () use ($loop) {
echo 'CTRL+C caught';
// cleanup...
// cleanup...
$loop->removeSignal(SIGINT);
});
$loop->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment