Permalink
Browse files

add maxListeners param to createClient

it helps with node.js emitter warning about too many listeners (default
== 11, 0 => no warnings)
  • Loading branch information...
1 parent ad44868 commit 000cf519608a07301aa0eb7c6ab4f6c8edd39cd4 @norlin norlin committed Oct 4, 2011
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/couchdb.js
  2. +1 −1 package.json
View
@@ -101,7 +101,7 @@ exports.toAttachment = function(file, cb) {
})
};
-exports.createClient = function(port, host, user, pass) {
+exports.createClient = function(port, host, user, pass, maxListeners) {
if (isNaN(port)) {
host = port;
port = 5984;
@@ -111,6 +111,10 @@ exports.createClient = function(port, host, user, pass) {
var
httpClient = http.createClient(port, host),
couchClient = new Client();
+
+ if (typeof maxListeners !== "undefined"){
+ httpClient.setMaxListeners(maxListeners);
+ }
couchClient.__defineGetter__('host', function() {
return host;
View
@@ -1,6 +1,6 @@
{
"name" : "felix-couchdb",
- "version" : "1.0.0",
+ "version" : "1.0.1",
"author" : "Alexey Makarov <alexey@norlin.ru>",
"description" : "A CouchDB module following node.js idioms, created by Felix Geisendörfer <felix@debuggable.com> and fixed a little by me",
"keywords" : ["couch", "couchdb"],

0 comments on commit 000cf51

Please sign in to comment.