title: Recursive process.nextTick warning
body: <p>As part of my app, I have the following lines of code:</p>
  
  <pre><code>process.nextTick(function() {
    // pre-populate cache with all users
    console.log('scanning users table in order to pre-populate cache');
    tables.users.scan(function(err, users) {
      if (err) {
        console.error('unable to scan users database in order to pre-populate cache');
        return;
      }
  
      console.log('found %d users in database', users.length);
    });
  });
  </code></pre>
  
  <p>running the app in ubuntu gives me</p>
  
  <pre><code>(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
  
  RangeError: Maximum call stack size exceeded
  </code></pre>
  
  <p>running on OSX is working good no warnings at all.</p>
  
  <p>Both run the same node version <code>v0.10.24</code>.</p>
  
  <p>Removing this block of code solves the problem. I am trying to figure out what's going on here.</p>
  
  <p>Trying to run node with <code>--trace-deprecation</code> flag shows</p>
  
  <pre><code>Trace: (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
      at maxTickWarn (node.js:377:17)
      at process.nextTick (node.js:480:9)
      at onwrite (_stream_writable.js:260:15)
      at WritableState.onwrite (_stream_writable.js:97:5)
      at WriteStream.Socket._write (net.js:651:5)
      at doWrite (_stream_writable.js:221:10)
      at writeOrBuffer (_stream_writable.js:211:5)
      at WriteStream.Writable.write (_stream_writable.js:180:11)
      at WriteStream.Socket.write (net.js:613:40)
      at Console.warn (console.js:61:16)
      at Console.trace (console.js:95:8)
      at maxTickWarn (node.js:377:17)
  </code></pre>
  
  <p>running with <code>--throw-deprecation</code> gives</p>
  
  <pre><code>Error: (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
      at maxTickWarn (node.js:375:15)
      at process.nextTick (node.js:480:9)
      at Cursor.each (/var/www/node_modules/mongojs/node_modules/mongodb/lib/mongodb/cursor.js:184:13)
      at /var/www/node_modules/mongojs/node_modules/mongodb/lib/mongodb/cursor.js:191:16
      at Cursor.nextObject (/var/www/node_modules/mongojs/node_modules/mongodb/lib/mongodb/cursor.js:540:5)
      at /var/www/node_modules/mongojs/node_modules/mongodb/lib/mongodb/cursor.js:187:12
      at process._tickCallback (node.js:415:13)
  </code></pre>
  
  <p>Any help much appreciated.</p>
  
  <p>10x</p>