Skip to content

distribworks/gcgrpcpool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRPC pool for groupcache

A replacement for groupcache HTTPPool that uses GRPC to communicate with peers.

Usage

server := grpc.NewServer()

p := NewGRPCPool("127.0.0.1:5000", server)
p.Set(peerAddrs...)

getter := groupcache.GetterFunc(func(ctx groupcache.Context, key string, dest groupcache.Sink) error {
	dest.SetString(...)
	return nil
})

groupcache.NewGroup("grpcPool", 1<<20, getter)
lis, err := net.Listen("tcp", "127.0.0.1:5000")
if err != nil {
	log.Fatalf("Failed to start server")
}

server.Serve(lis)

Use GRPCPoolOptions to set the GRPC client dial options such as using compression, authentication etc.

To Do

  • Use GRPC Balancer to manage the peer connections
  • Peer discovery mechanism for Kubernetes

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.0%
  • Makefile 3.0%