You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be cool if this could notify only after the spawned CouchDB was ready for connections.
var mc = require('multicouch'),
f = require('fermata');
var TEST_PORT = 4984;
var my_couch = new mc({port:TEST_PORT, prefix: "/tmp"});
my_couch.start();
my_couch.on('start', function () {
f.json("http://localhost:"+TEST_PORT)._all_dbs.get(function (e,d) {
console.log(e,d);
});
});
The code above doesn't work for two reasons:
the start event is emitted synchronously, so it can't be registered later
even if I move start to after the event registration, it's still called to early and I get ECONNREFUSED
The text was updated successfully, but these errors were encountered:
This is because CouchDB’s startup is async as well, after we launch the cli script, we need to periodically request http://couch_url:port/ until we get a valid response before emitting 'start'.
It'd be cool if this could notify only after the spawned CouchDB was ready for connections.
The code above doesn't work for two reasons:
The text was updated successfully, but these errors were encountered: