rpc

package
v0.0.0-...-3f65307 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AcceptorReceivePrepare ...
	AcceptorReceivePrepare = "Server.AcceptorReceivePrepare"
	// AcceptorReceivePropose ...
	AcceptorReceivePropose = "Server.AcceptorReceivePropose"
)

Service methods

Variables

This section is empty.

Functions

func Fibonacci

func Fibonacci() func() int

Fibonacci returns successive Fibonacci numbers starting from 1

func RunServer

func RunServer(server *Server) error

RunServer registers service methods and HTTP handler for RPC messages

Types

type Client

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

Client ...

func NewClient

func NewClient(url string) *Client

NewClient returns new instance of Client

func (*Client) GetName

func (c *Client) GetName() string

GetName ...

func (*Client) SendPrepare

func (c *Client) SendPrepare(proposal *paxos.Proposal) (*paxos.Proposal, error)

SendPrepare sends a prepare request to acceptor

func (*Client) SendPropose

func (c *Client) SendPropose(proposal *paxos.Proposal) (*paxos.Proposal, error)

SendPropose sends a propose request to acceptor

type Server

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

Server ...

func NewServer

func NewServer(acceptor *paxos.Acceptor) *Server

NewServer returns new instance of Server

func (*Server) AcceptorReceivePrepare

func (s *Server) AcceptorReceivePrepare(proposal, reply *paxos.Proposal) error

AcceptorReceivePrepare handles prepare requests from proposers

func (*Server) AcceptorReceivePropose

func (s *Server) AcceptorReceivePropose(proposal, reply *paxos.Proposal) error

AcceptorReceivePropose handles propose requests from proposers

Jump to

Keyboard shortcuts

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