rpc

package
v0.0.0-...-c2bae5a Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package rpc provides RPC server and clients specific to Cockroach.

Index

Constants

View Source
const (
	// OrderStable uses endpoints in the order provided.
	OrderStable = iota
	// OrderRandom randomly orders available endpoints.
	OrderRandom
)

Variables

This section is empty.

Functions

func Send

func Send(opts Options, method string, addrs []net.Addr, getArgs func(addr net.Addr) interface{},
	getReply func() interface{}, context *Context) ([]interface{}, error)

Send sends one or more method RPCs to clients specified by the slice of endpoint addrs. Arguments for methods are obtained using the supplied getArgs function. The number of required replies is given by opts.N. Reply structs are obtained through the getReply() function. On success, Send returns a slice of replies of length opts.N. Otherwise, Send returns an error if and as soon as the number of failed RPCs exceeds the available endpoints less the number of required replies.

Types

type Client

type Client struct {
	Ready  chan struct{} // Closed when client is connected
	Closed chan struct{} // Closed when connection has closed

	*