sequential-ids
Advanced tools
Comparing version 0.0.0-alpha.5.0 to 0.0.0
@@ -13,3 +13,7 @@ var http = require("http"); | ||
http.get(this.url + "/ping", function(res) { | ||
callback(null); | ||
// Waiting for the `end` event seems to require that | ||
// we first listen to `data` event Otherwise, the | ||
// callback wont be fired. | ||
res.on("data", function(){}); | ||
res.on("end", function() {callback(null);}); | ||
}).on("error", function(err) { | ||
@@ -16,0 +20,0 @@ callback(err); |
@@ -170,4 +170,5 @@ var http = require("http"); | ||
Generator.prototype.start = function() { | ||
if (this._started) return; | ||
Generator.prototype.start = function(done) { | ||
done = done || function() {}; | ||
if (this._online) return; | ||
this.server = http.Server(function(req, res) { | ||
@@ -186,4 +187,4 @@ if(req.url.match(/(^\/\w+)(?:\/(\w+))?/)){ | ||
}.bind(this)); | ||
this.server.listen(this.options.port); | ||
this._started = true; | ||
this.server.listen(this.options.port, done); | ||
this._online = true; | ||
}; | ||
@@ -197,3 +198,3 @@ | ||
Generator.prototype.stop = function() { | ||
if (this._stopped || !this._started) return; | ||
if (! this._online) return; | ||
for(var key in this.keys){ | ||
@@ -203,3 +204,3 @@ this.store(key); | ||
this.server.close(); | ||
this._stopped = true; | ||
this._online = false; | ||
}; | ||
@@ -206,0 +207,0 @@ |
{ | ||
"name": "sequential-ids", | ||
"version": "0.0.0-alpha.5.0", | ||
"version": "0.0.0", | ||
"description": "centralized generation of sequential, human-readable ids", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/forfuture-dev/node-sequential-ids", |
@@ -13,6 +13,6 @@ | ||
|-------|-----:| | ||
|version|0.0.0-alpha.5.0| | ||
|version|0.0.0| | ||
|dependencies|none| | ||
|node|0.11, 0.10| | ||
|last updated|24th Oct, 2014| | ||
|last updated|11th December, 2014| | ||
@@ -19,0 +19,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16571
244