hash_ring 0.1.3 copy "hash_ring: ^0.1.3" to clipboard
hash_ring: ^0.1.3 copied to clipboard

Dart 1 only

A consistent hashing implementation

Hash Ring #

A consistent hashing implementation in Dart.

Tested with Dart 0.4.7

Examples #

import "package:hash_ring/hash_ring.dart";

main() {

  var ring = new HashRing<String>.from([
    new HashRingNode("cache-prod001", 40),
    new HashRingNode("cache-prod002", 40),
    new HashRingNode("cache-prod003", 40),
    new HashRingNode("cache-prod004", 40),
    new HashRingNode("cache-prod005", 40)
  ]);

  print(ring.getNode("user:joseph").get());
  print(ring.getNode("user:carolina").get());
  print(ring.getNode("user:isaiah").get());

}
0
likes
15
points
11
downloads

Publisher

unverified uploader

Weekly Downloads

A consistent hashing implementation

Homepage

License

MIT (license)

Dependencies

crc32, dictionary, meta, option, sorted_set, unittest

More

Packages that depend on hash_ring