News for hackers. Stuff that matters.
Re:Building A Node.js Server That Won't Melt by mnarayan01 on Tuesday January 15, 2013 @01:26PM (#5061839)

  // check if we're toobusy() - note, this call is extremely fast, and returns
  // state that is calculated asynchronously.  
  if (toobusy()) res.send(503, "I'm busy right now, sorry.");
Saying it is calculated "asynchronously" seems pretty confusing in this context. Maybe "is cached at a fixed interval"?
Re:Building A Node.js Server That Won't Melt by firefoxman1 on Tuesday January 15, 2013 @04:21PM (#5063080)
Side note: caching at a fixed interval is a great way to save CPU cycles. If you're serving 100req/s and you had to grab the current time within 1sec accuracy for them, you could have 1/100th the amount of Date calls by getting the time each second instead of each request.
Re:Building A Node.js Server That Won't Melt by lloydhilaiel on Tuesday January 15, 2013 @01:29PM (#5061862)
I agree. /me fixes
Re:Building A Node.js Server That Won't Melt by wereHamster on Tuesday January 15, 2013 @07:27PM (#5064161)
Nope, it is literally calculated asynchronously. Look at https://github.com/lloyd/node-toobusy/blob/master/toobusy.cc... and lines 91/92 which sets up the background timer.