Questions tagged [q]

The Q.js JavaScript promise library. Q catches errors and uses a `then` technique to handle JavaScript callbacks and exceptions. Do *not* use for Angular's $q, use [angular-promise] instead! Also do *not* use for kx System's kdb+/q, use [kdb] or [q-lang] instead! Lastly, this tag should not be used for questions regarding Android 10 - use the [android-10.0] tag instead!

A JavaScript library for the browser and Node.js for making and composing asynchronous promises. Q catches errors and uses a then technique to handle JavaScript callbacks and exceptions.

1381 questions
14
votes
1 answer

Unhandled rejection reasons (should be empty)

I'm getting into promises pattern with Q and I keep getting warning "[Q] Unhandled rejection reasons (should be empty)" in console. What em I doing wrong? http://jsfiddle.net/FpyDr/1/ function load(url) { var deferred = Q.defer(); $.ajax({ …
Lukáš Novotný
  • 9,012
  • 3
  • 38
  • 46
13
votes
1 answer

Chaining waterline calls with Promises

I have been hitting my head off a wall on this for the last 3 days. I am using sailsjs & the waterline ORM that comes bundled. I want to run DB calls one after an other. I know I can do this by nesting inside "then" calls but it just looks wrong. I…
Brian
  • 1,026
  • 1
  • 15
  • 25
13
votes
4 answers

How can I limit Q promise concurrency?

How do I write a method that limits Q promise concurrency? For instance, I have a method spawnProcess. It returns a Q promise. I want no more than 5 process spawned at a time, but transparently to the calling code. What I need to implement is a…
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511
13
votes
2 answers

Stop memory leaks with recursive promises

How do I create a recursive chain of JavaScript Promises with the Q library? The following code fails to complete in Chrome: