From e5c57d536cd805e0d0db9725afd267ab5ad9ee02 Mon Sep 17 00:00:00 2001 From: Ross Squires Date: Wed, 29 Apr 2015 13:30:51 -0400 Subject: [PATCH 1/5] Added custom client support --- lib/node-redis-pubsub.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/node-redis-pubsub.js b/lib/node-redis-pubsub.js index c4defa4..311e11f 100644 --- a/lib/node-redis-pubsub.js +++ b/lib/node-redis-pubsub.js @@ -14,10 +14,18 @@ function NodeRedisPubsub(options){ var host = options && options.host || '127.0.0.1'; var auth = options && options.auth + function createClient() { + if (options && options.createClient) { + return options.createClient(); + } else { + return redis.createClient(port, host); + } + }; + // Need to create two Redis clients as one cannot be both in receiver and emitter mode // I wonder why that is, by the way ... - this.emitter = redis.createClient(port, host); - this.receiver = redis.createClient(port, host); + this.emitter = createClient(); + this.receiver = createClient(); if (auth) { this.emitter.auth(auth) From c736ba1025feaf186c2d9d46581e0d2a8011e6da Mon Sep 17 00:00:00 2001 From: Ross Squires Date: Mon, 22 Feb 2016 08:47:08 -0500 Subject: [PATCH 2/5] Removing IDEA files --- .idea/.name | 1 - .idea/encodings.xml | 6 - .idea/jsLibraryMappings.xml | 6 - .idea/misc.xml | 16 --- .idea/modules.xml | 8 -- .idea/node-redis-pubsub.iml | 8 -- .idea/vcs.xml | 6 - .idea/workspace.xml | 241 ------------------------------------ 8 files changed, 292 deletions(-) delete mode 100644 .idea/.name delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/jsLibraryMappings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/node-redis-pubsub.iml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 8a50ece..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -node-redis-pubsub \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml deleted file mode 100644 index b8387eb..0000000 --- a/.idea/jsLibraryMappings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index eabe228..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 130e588..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/node-redis-pubsub.iml b/.idea/node-redis-pubsub.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/node-redis-pubsub.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 743090d..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $PROJECT_DIR$ - true - - bdd - - DIRECTORY - - false - - - - - - - - 1456148615861 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From ec26a91d7937fa714c2ffe1b815b3a6296754d8d Mon Sep 17 00:00:00 2001 From: Ross Squires Date: Mon, 22 Feb 2016 08:49:03 -0500 Subject: [PATCH 3/5] Fix spacing --- .idea/workspace.xml | 251 +++++++++++++++++++++++++++++++++++++++ lib/node-redis-pubsub.js | 2 +- 2 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..84db767 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $PROJECT_DIR$ + true + + bdd + + DIRECTORY + + false + + + + + + + + 1456148615861 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/node-redis-pubsub.js b/lib/node-redis-pubsub.js index 283eeb2..88bf000 100644 --- a/lib/node-redis-pubsub.js +++ b/lib/node-redis-pubsub.js @@ -20,7 +20,7 @@ function NodeRedisPubsub(options){ if (options && options.createClient) { return options.createClient(); } else { - return redis.createClient(port, host); + return redis.createClient(options); } }; From 1eeaee0a09f33450ef1c1d73c5fc9aea06ffdb38 Mon Sep 17 00:00:00 2001 From: Ross Squires Date: Mon, 22 Feb 2016 08:49:29 -0500 Subject: [PATCH 4/5] Removing IDEA --- .idea/workspace.xml | 251 -------------------------------------------- 1 file changed, 251 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 84db767..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,251 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $PROJECT_DIR$ - true - - bdd - - DIRECTORY - - false - - - - - - - - 1456148615861 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 152d66e5d27751b8e45971cf868502b1b3fe9b8e Mon Sep 17 00:00:00 2001 From: Ross Squires Date: Mon, 22 Feb 2016 08:51:07 -0500 Subject: [PATCH 5/5] Shortening if statement --- lib/node-redis-pubsub.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node-redis-pubsub.js b/lib/node-redis-pubsub.js index 88bf000..45e7d08 100644 --- a/lib/node-redis-pubsub.js +++ b/lib/node-redis-pubsub.js @@ -17,7 +17,7 @@ function NodeRedisPubsub(options){ options.host = options.host || '127.0.0.1'; function createClient() { - if (options && options.createClient) { + if (options.createClient) { return options.createClient(); } else { return redis.createClient(options);