go-micro: github.com/micro/go-micro/util/pool Index | Files

package pool

import "github.com/micro/go-micro/util/pool"

Package pool is a connection pool

Index

Package Files

default.go options.go pool.go

type Conn Uses

type Conn interface {
    // unique id of connection
    Id() string
    // time it was created
    Created() time.Time
    // embedded connection
    transport.Client
}

type Option Uses

type Option func(*Options)

func Size Uses

func Size(i int) Option

func TTL Uses

func TTL(t time.Duration) Option

func Transport Uses

func Transport(t transport.Transport) Option

type Options Uses

type Options struct {
    Transport transport.Transport
    TTL       time.Duration
    Size      int
}

type Pool Uses

type Pool interface {
    // Close the pool
    Close() error
    // Get a connection
    Get(addr string, opts ...transport.DialOption) (Conn, error)
    // Releaes the connection
    Release(c Conn, status error) error
}

Pool is an interface for connection pooling

func NewPool Uses

func NewPool(opts ...Option) Pool

Package pool imports 4 packages (graph) and is imported by 2 packages. Updated 2020-02-22. Refresh now. Tools for package owners.