STRML / node-toobusy

Don't let your Node.JS server fall over when it's too busy.
366 stars 36 forks source link

Documentation may be slightly misleading #3

Closed michaelsanford closed 9 years ago

michaelsanford commented 9 years ago

The following line in the readme

// set maximum lag to an aggressive value 
require('toobusy-js').maxLag(10);

suggests that you can do this:

var toobusy = require( 'toobusy-js' ).maxLag(10);

which you cannot, as it predictably throws TypeError: number is not a function.

You must break it up into two method calls:

// set maximum lag to an aggressive value 
var toobusy = require('toobusy-js');
toobusy.maxLag(10);