Created
August 10, 2012 00:41
-
-
Save briancavalier/3309660 to your computer and use it in GitHub Desktop.
Infinite loop interaction between q.js and when.js
This file contains 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
// `npm install q when` | |
// `node test.js` | |
// watch CPU and memory using top | |
var q, when; | |
q = require('q'); | |
when = require('when/debug'); | |
// Infinite loop | |
q.resolve(1).then(when.resolve) | |
.then(console.log, console.error); | |
// Infinite loop | |
//when.resolve(1).then(q.resolve) | |
// .then(console.log, console.error); | |
// Works correctly | |
//q.resolve(1).then(q.resolve) | |
// .then(console.log, console.error); | |
// Works correctly | |
//when.resolve(1).then(when.resolve) | |
// .then(console.log, console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment