Skip to content

Commit

Permalink
docs: add the custom hasher doc to the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tochemey committed Oct 12, 2024
1 parent 0bd7756 commit fbb697f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ Go-Akt client is equipped with a mini load-balancer that helps route requests to
The cluster engine depends upon the [discovery](./discovery/provider.go) mechanism to find other nodes in the cluster.
Under the hood, it leverages [Olric](https://github.com/buraksezer/olric)
to scale out and guarantee performant, reliable persistence, simple scalability, partitioning (sharding), and
re-balancing out-of-the-box. _**It requires remoting to be enabled**_.
re-balancing out-of-the-box. _**It requires remoting to be enabled**_. One can implement a custom hasher for the partitioning using
the [Hasher](./hash/hasher.go) interface and the `Actor System` [option](./actors/option.go) to set it. The default hasher uses the `XXH3 algorithm`.

At the moment the following providers are implemented:

Expand Down
1 change: 1 addition & 0 deletions hash/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
)

// Hasher defines the hashcode generator interface.
// This help for actors partitioning when cluster mode is enabled
type Hasher interface {
// HashCode is responsible for generating unsigned, 64-bit hash of provided byte slice
HashCode(key []byte) uint64
Expand Down

0 comments on commit fbb697f

Please sign in to comment.