Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Preparing 0.0.5

  • Loading branch information...
commit 62c7d15cbaeaac82a70ab771ada468db213ff331 1 parent fa13e60
@3rd-Eden authored
Showing with 10 additions and 5 deletions.
  1. +8 −3 doc/index.html
  2. +1 −1  lib/hashring.js
  3. +1 −1  package.json
View
11 doc/index.html
@@ -128,10 +128,10 @@
<h2></h2>
-<ul><li><p><strong>param</strong>: <em>mixed</em> arg The server / weights / servers for the hashring</p></li><li><p><strong>param</strong>: <em>String</em> [algorithm] The algorithm that should be used to hash the keys.</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>
+<ul><li><p><strong>param</strong>: <em>mixed</em> arg The server / weights / servers for the hashring</p></li><li><p><strong>param</strong>: <em>String</em> [algorithm] The algorithm that should be used to hash the keys.</p></li><li><p><strong>param</strong>: <em>Object</em> [options] Extra configuration options for the hash ring.</p></li><li><p><strong>api</strong>: <em>public</em></p></li></ul>
</td>
<td class="code">
-<pre><code><span class="keyword">function</span> <span class="variable">hashRing</span>(<span class="variable">args</span>, <span class="variable">algorithm</span>){
+<pre><code><span class="keyword">function</span> <span class="variable">hashRing</span>(<span class="variable">args</span>, <span class="variable">algorithm</span>, <span class="variable">options</span>){
<span class="keyword">var</span> <span class="variable">nodes</span> = []
, <span class="variable">weights</span> = {};
@@ -163,6 +163,11 @@
<span class="this">this</span>.<span class="variable">hashKey</span> = <span class="this">this</span>.<span class="variable">crc32HashKey</span>;
}
+ <span class="this">this</span>.<span class="variable">options</span> = {<span class="variable">vnode_count</span>: <span class="number integer">40</span>};
+ <span class="keyword">if</span> (<span class="variable">options</span> &<span class="variable">amp</span>;&<span class="variable">amp</span>; <span class="variable">options</span>.<span class="variable">vnode_count</span>) {
+ <span class="this">this</span>.<span class="variable">options</span>.<span class="variable">vnode_count</span> = <span class="variable">options</span>.<span class="variable">vnode_count</span>;
+ }
+
<span class="this">this</span>.<span class="variable">generateRing</span>();
};
@@ -434,7 +439,7 @@
</p>
</td>
<td class="code">
-<pre><code><span class="variable">hashRing</span>.<span class="variable">version</span> = <span class="string">'0.0.3'</span>;
+<pre><code><span class="variable">hashRing</span>.<span class="variable">version</span> = <span class="string">'0.0.5'</span>;
<span class="variable">module</span>.<span class="variable">exports</span> = <span class="variable">hashRing</span>;</code></pre>
</td>
View
2  lib/hashring.js
@@ -345,6 +345,6 @@ HashRing.crc32HashKey = function(str){
/**
* Library version
*/
-hashRing.version = '0.0.4';
+hashRing.version = '0.0.5';
module.exports = hashRing;
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "hashring"
-, "version": "0.0.4"
+, "version": "0.0.5"
, "author": "Arnout Kazemier"
, "description": "A pure JavaScript hash ring based on libketama"
, "main": "index"
Please sign in to comment.
Something went wrong with that request. Please try again.