pool

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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