• Javascript
  • 11 lines
  • 11 views
  • 1 fork
  • Pasted by anonymous on January 7, 2012
// check for new stuff periodically
var timer = setInterval( function() {
                   var resp = getResponseObject();
                   response.write(resp + "\n\r");
               }, 500);

// stop looping when the client disconnects
request.on('close', function() {
             clearInterval(timer);
             return;
             });

Did you know? CLOSE

  • There are keyboard shortcuts!
    • When Creating A Paste
      • ALT+P Toggle Private
      • CTRL+Enter Create Paste
      • ALT+W Toggle word wrap
    • When Viewing A Paste
      • ALT+G Go to a line
      • ALT+CTRL+E Edit the paste
      • ALT+R Show the raw code
  • There are URL options!
    • When Creating A Paste
      • ?lang=Javascript to default to javascript
    • When Viewing A Paste
      • #L-N Jump to line number N
?