Created
May 3, 2010 11:32
-
-
Save bryanwb/387992 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var sys = require('sys'); | |
| stdin = process.openStdin(); | |
| process.addListener('SIGINT', function(){ | |
| sys.puts('Received SIGINT'); | |
| }); | |
| var timeout = function(){ | |
| setTimeout(timeout, 50); | |
| }; | |
| setTimeout(function(){ | |
| timeout(); | |
| }, 10); | |
| /* while loop doesn't work because it blocks the whole node process | |
| while (true){ | |
| ; | |
| } | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment