package peers

import "github.com/uber/tchannel-go/peers"

Package peers provides helpers for managing TChannel peers.

Index

Functions

func NewHRWScorer

func NewHRWScorer(clientID uint32) tchannel.ScoreCalculator

NewHRWScorer returns a ScoreCalculator based on Rendezvous or Highest Random Weight hashing. It is useful for distributing load in peer-to-peer situations where we have many clients picking from a set of servers with "sticky" semantics that will spread load evenly as servers go down or new servers are added. The clientID is used to score the servers, so each client should pass in a unique client ID.

Source Files

doc.go prefer.go

Version
v1.34.6 (latest)
Published
Jan 8, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
1 hour ago

Tools for package owners.