labrpc

package
v0.0.0-...-526be01 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientEnd

type ClientEnd struct {
	// contains filtered or unexported fields
}

func (*ClientEnd) Call

func (e *ClientEnd) Call(svcMeth string, args interface{}, reply interface{}) bool

send an RPC, wait for the reply. the return value indicates success; false means that no reply was received from the server.

type Network

type Network struct {
	// contains filtered or unexported fields
}

func MakeNetwork

func MakeNetwork() *Network

func (*Network) AddServer

func (rn *Network) AddServer(servername interface{}, rs *Server)

func (*Network) Connect

func (rn *Network) Connect(endname interface{}, servername interface{})

connect a ClientEnd to a server. a ClientEnd can only be connected once in its lifetime.

func (*Network) DeleteServer

func (rn *Network) DeleteServer(servername interface{})

func (*Network) Enable

func (rn *Network) Enable(endname interface{}, enabled bool)

enable/disable a ClientEnd.

func (*Network) GetCount

func (rn *Network) GetCount(servername interface{}) int

get a server's count of incoming RPCs.

func (*Network) IsServerDead

func (rn *Network) IsServerDead(endname interface{}, servername interface{}, server *Server) bool

func (*Network) LongDelays

func (rn *Network) LongDelays(yes bool)

func (*Network) LongReordering

func (rn *Network) LongReordering(yes bool)

func (*Network) MakeEnd

func (rn *Network) MakeEnd(endname interface{}) *ClientEnd

create a client end-point. start the thread that listens and delivers.

func (*Network) ProcessReq

func (rn *Network) ProcessReq(req reqMsg)

func (*Network) ReadEndnameInfo

func (rn *Network) ReadEndnameInfo(endname interface{}) (enabled bool,
	servername interface{}, server *Server, reliable bool, longreordering bool,
)

func (*Network) Reliable

func (rn *Network) Reliable(yes bool)

type Server

type Server struct {
	// contains filtered or unexported fields
}

a server is a collection of services, all sharing the same rpc dispatcher. so that e.g. both a Raft and a k/v server can listen to the same rpc endpoint.

func MakeServer

func MakeServer() *Server

func (*Server) AddService

func (rs *Server) AddService(svc *Service)

func (*Server) GetCount

func (rs *Server) GetCount() int

type Service

type Service struct {
	// contains filtered or unexported fields
}

an object with methods that can be called via RPC. a single server may have more than one Service.

func MakeService

func MakeService(rcvr interface{}) *Service

Jump to

Keyboard shortcuts

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