Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/zzy987/grpc_consistent_hash_balancer

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/zzy987/grpc_consistent_hash_balancer

  • v0.0.0-20210907034000-668ca661c772
  • Source
  • Go
  • Socket score

Version published
Created
Source

GRPC Consistent Hash Balancer

A demo of a grpc balancer using consistent hash

Features

  • Consistent Hash Ring: All servers are abstracted into a hash ring in the picker, implemented in /client/balancer/consistent_hash_picker.

  • On-demand Connections Setting up: Different from the default behavior of grpc to set up connections with all servers, I use a trick to make connections set up on-demand, implemented in /client/balancer/consistent_hash_balancer.

  • Retry in Interceptor: Unlike the retry example of grpc which implements retry ability with a service config, I implement it in the interceptor, for service config based retry Because retry based on service config will ignore some errors in streaming, implemented in /client/main.

  • Connection Survival Management: The balancer will reset a connection to idle when it has not been using for too long, for it seems like grpc will not close any connection unless some network exception happens, implemented in /client/balancer/consistent_hash_balancer.

FAQs

Package last updated on 07 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc