Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

charithe/gcgrpcpool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 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

About

GRPC pool for groupcache

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published