Permalink
Browse files

Update to use q 0.8.10

  • Loading branch information...
1 parent 34d2b24 commit fd8e287583eabd6c93c3bfa3688a3e30584f9794 @arikon arikon committed Nov 7, 2012
Showing with 8 additions and 10 deletions.
  1. +1 −1 package.json
  2. +1 −1 q-http.js
  3. +2 −3 test/deferred.js
  4. +4 −5 test/keep-alive.js
View
2 package.json
@@ -16,7 +16,7 @@
],
"main": "q-http.js",
"dependencies": {
- "q": "0.8.4",
+ "q": "0.8.10",
"q-io": "0.0.13"
},
"devDependencies": {
View
2 q-http.js
@@ -84,7 +84,7 @@ exports.Server = function (respond) {
})
})
- .end(); // should be .fail(self.emitter("error"))
+ .done(); // should be .fail(self.emitter("error"))
});
View
5 test/deferred.js
@@ -31,7 +31,7 @@ var server = HTTP.Server(function () {
return response;
});
-Q.when(server.listen(8080), function () {
+Q.done(server.listen(8080), function () {
return Q.when(HTTP.request(request), function (response) {
return Q.when(response.body, function (body) {
var done = body.forEach(function (chunk) {
@@ -40,6 +40,5 @@ Q.when(server.listen(8080), function () {
Q.when(done, server.stop);
});
});
-})
-.end();
+});
View
9 test/keep-alive.js
@@ -24,19 +24,18 @@ var server = HTTP.Server(function () {
return response;
});
-Q.when(server.listen(8080), function () {
+Q.done(server.listen(8080), function () {
var done = [1,2,3].reduce(function (done) {
return Q.when(HTTP.request(request), function (response) {
return Q.when(response.body, function (body) {
- return Q.when(body.forEach(function (chunk) {
+ return Q.all([body.forEach(function (chunk) {
console.log(chunk.toString('utf-8'));
- })).wait(done);
+ }), done]);
});
});
}, undefined);
return Q.when(done, server.stop);
-})
-.end();
+});

0 comments on commit fd8e287

Please sign in to comment.