Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Only process next tick when response is received

  • Loading branch information...
commit 288b3575f97ab9120f90506081d6fa5e75848683 1 parent 543aa32
@trotter trotter authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/cube/emitter-http.js
View
6 lib/cube/emitter-http.js
@@ -25,7 +25,9 @@ module.exports = function(protocol, host, port) {
}
};
- var postRequest = http.request(postOptions, function() {});
+ var postRequest = http.request(postOptions, function(res) {
+ if (queue.length) process.nextTick(send);
+ });
postRequest.on('error', function (e) {
console.warn(e.message);
@@ -33,8 +35,6 @@ module.exports = function(protocol, host, port) {
postRequest.write(body);
postRequest.end();
-
- if (queue.length) process.nextTick(send);
}
emitter.send = function(event) {
Please sign in to comment.
Something went wrong with that request. Please try again.