Permalink
Browse files

Merge branch 'fix-emitter-close'

  • Loading branch information...
2 parents 7f5608b + 33d47ab commit 1b8779e0af04e26a5cd05ff2aa4edc746c9e30ed @mbostock mbostock committed Nov 18, 2011
Showing with 10 additions and 3 deletions.
  1. +8 −1 lib/cube/server/emitter.js
  2. +2 −2 package.json
@@ -16,6 +16,13 @@ module.exports = function() {
}
}
+ function closeWhenDone() {
+ if (socket) {
+ if (!socket.bytesWaitingToFlush) close();
+ else setTimeout(closeWhenDone, 1000);
+ }
+ }
+
function open() {
timeout = 0;
close();
@@ -59,7 +66,7 @@ module.exports = function() {
};
emitter.close = function() {
- close();
+ closeWhenDone();
return emitter;
};
View
@@ -1,14 +1,14 @@
{
"name": "cube",
- "version": "0.0.9",
+ "version": "0.0.10",
"description": "A system for time series visualization using MongoDB, Node and D3.",
"keywords": ["time series", "visualization"],
"homepage": "http://square.github.com/cube/",
"author": {"name": "Mike Bostock", "url": "http://bost.ocks.org/mike"},
"repository": {"type": "git", "url": "http://github.com/square/cube.git"},
"main": "./lib/cube",
"dependencies": {
- "d3": "2.4.2",
+ "d3": "2.5.1",
"mongodb": "0.9.6-15",
"pegjs": "0.6.2",
"vows": "0.5.11",

0 comments on commit 1b8779e

Please sign in to comment.