Skip to content
Browse files

Add vnodes config to readme

  • Loading branch information...
1 parent 0447337 commit ec369a77387fa4241c2b734c92513232c5e9f059 Gabriel Eisbruch committed Sep 18, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 README.md
View
12 README.md
@@ -41,6 +41,18 @@ var ring = new hashring({
});
```
+Creating a hash ring with multiple servers an vnodes selected per nodes
+
+``` javascript
+var hashring = require('hashring');
+var ring = new hashring({
+ '192.168.0.102:11212': {"vnodes": 5}
+, '192.168.0.103:11212': {"vnodes": 10}
+, '192.168.0.104:11212': {"vnodes": 7}
+});
+```
+Optionaly you could add the weigth property to the object.
+
By default the hash ring uses a JavaScript crc32 implementation hashing algorithm. But this can be overwritten by adding a second argument to the constructor. This can be anything that is supported as hashing algorithm by the crypto module.
``` javascript

0 comments on commit ec369a7

Please sign in to comment.
Something went wrong with that request. Please try again.