grpcpool

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ClosedErr pool has closed
	ClosedErr = stderr.New("grpc pool has closed")
)

Functions

This section is empty.

Types

type Builder

type Builder func() (*grpc.ClientConn, error)

Builder builer for create grpc client connection

type ClientConn

type ClientConn interface {
	grpc.ClientConnInterface
	// contains filtered or unexported methods
}

ClientConn wrapper for *grpc.ClientConn

type Option

type Option func(*option)

Option optional configs

func WithEnablePrometheus

func WithEnablePrometheus() Option

WithEnablePrometheus enable to record prometheus metrics

type Pool

type Pool interface {
	Close()
	Get() (Stub, error)
	Restore(Stub)
}

Pool grpc pool

func NewPool

func NewPool(builder Builder, options ...Option) (Pool, error)

NewPool create a grpc pool

type Stub

type Stub interface {
	Conn() ClientConn
	// contains filtered or unexported methods
}

Stub the real handler in pool

Jump to

Keyboard shortcuts

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