Skip to main content

Crate lightcycle

Crate lightcycle 

Source
Expand description

A consistent hash ring implementation using configurable hash functions.

LightCycle provides a way to distribute items to specific instances of otherwise-identical resources in a balanced way. You have two choices of distribution method: the rendezvous hash, and the more specific case of the consistent hash. The rendezvous hash is in more general use and has better performance characteristics overall, but the consistent hash is still a fun data structure. Both structures can be used for cache sharding, load balancing with session affinity, distributed systems coordination, and light cycle distribution. For the users!

Modules§

hashes
Hash function abstraction for consistent hashing

Structs§

ConsistentRing
A consistent hash ring implementation.
RendezvousRing
A rendezvous hash ring implementation with support for weighted nodes.

Enums§

LightCycleError
We only have two errors, so let’s define them right here.

Traits§

HasId
Things that we can store in the ring must have an ID string they advertise. This can be human-meaningful or not, but you must supply it.
HashRing

Type Aliases§

EndOfLine
Ty curtosis for the name for our error type!
LightCycle
Fun names! Use these or be boring.
Recognizer