pool

package
v1.7.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool stores a pool of grpc connections to a k8s service, it's useful in places where you would otherwise need to keep recreating connections.

func NewPool

func NewPool(kubeClient *kube.Clientset, namespace string, serviceName string, port int, queueSize int64, opts ...grpc.DialOption) (*Pool, error)

NewPool creates a new connection pool with connections to pods in the given service.

func (*Pool) Close

func (p *Pool) Close() error

Close closes all connections stored in the pool, it returns an error if any of the calls to Close error.

func (*Pool) Do added in v1.5.1

func (p *Pool) Do(ctx context.Context, f func(cc *grpc.ClientConn) error) error

Do allows you to do something with a grpc.ClientConn. Errors returned from f will be returned by Do.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL