rpcutil

package
v0.0.0-...-66bb59c Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Call(method string, args interface{}, reply interface{}) error
	Go(method string, args interface{}, reply interface{}, done chan *rpc.Call) *rpc.Call
	Close() error
}

Client ...

type ClientFactory

type ClientFactory func(addr string) (*rpc.Client, error)

ClientFactory for NewClient

type Clients

type Clients []Client

Clients ...

func (Clients) Close

func (cl Clients) Close() error

Close ...

type Peers

type Peers struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Peers ...

func NewPeers

func NewPeers(maxConns int, factory ClientFactory) *Peers

NewPeers ...

func (*Peers) Get

func (p *Peers) Get(addr string) *Pool

Get ...

func (*Peers) Join

func (p *Peers) Join(addr string) error

Join ...

func (*Peers) Leave

func (p *Peers) Leave(addr string) error

Leave ...

func (*Peers) LeaveAll

func (p *Peers) LeaveAll() error

LeaveAll ...

func (*Peers) List

func (p *Peers) List() []string

List ...

type Pool

type Pool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Pool ...

func NewPool

func NewPool(max int, factory func() (*rpc.Client, error)) *Pool

NewPool ...

func (*Pool) Close

func (p *Pool) Close() error

Close ...

func (*Pool) Get

func (p *Pool) Get() (Client, error)

Get ...

func (*Pool) GetService

func (p *Pool) GetService(prefix string) (Client, error)

GetService ...

Jump to

Keyboard shortcuts

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