transport

package
v0.0.0-...-425bd36 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EPaxosClient

type EPaxosClient struct {
	transpb.EPaxosTransportClient
	*grpc.ClientConn
}

EPaxosClient is a client stub implementing the EPaxosTransportClient interface.

func NewEPaxosClient

func NewEPaxosClient(addr string) (*EPaxosClient, error)

NewEPaxosClient creates a new EPaxosClient.

type EPaxosServer

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

EPaxosServer handles internal and external RPC messages for an EPaxos node.

func NewEPaxosServer

func NewEPaxosServer(port int) (*EPaxosServer, error)

NewEPaxosServer creates a new EPaxosServer.

func (*EPaxosServer) DeliverMessage

func (ps *EPaxosServer) DeliverMessage(
	stream transpb.EPaxosTransport_DeliverMessageServer,
) error

DeliverMessage implements the PaxosTransportServer interface. It receives each message from the client stream and passes it to the server's message channel.

func (*EPaxosServer) Msgs

func (ps *EPaxosServer) Msgs() <-chan *epaxospb.Message

Msgs returns the channel that all Paxos messages will be delivered from the server on.

func (*EPaxosServer) Read

Read implements the KVServiceServer interface. It receives the KVReadRequest from the client and passes it as a Request on the server's update channel. The method will block until the update is globally ordered.

func (*EPaxosServer) Requests

func (ps *EPaxosServer) Requests() <-chan Request

Requests returns the channel that all client requests will be delivered from the server on.

func (*EPaxosServer) Serve

func (ps *EPaxosServer) Serve() error

Serve begins serving on server, blocking until Stop is called or an error is observed.

func (*EPaxosServer) Stop

func (ps *EPaxosServer) Stop()

Stop stops the EPaxosServer.

func (*EPaxosServer) Write

Write implements the KVServiceServer interface. It receives the KVWriteRequest from the client and passes it as a Request on the server's update channel. The method will block until the update is globally ordered and applied.

type ExternalClient

type ExternalClient struct {
	transpb.KVServiceClient
	*grpc.ClientConn
}

ExternalClient is a client stub implementing the KVServiceClient interface.

func NewExternalClient

func NewExternalClient(addr string) (*ExternalClient, error)

NewExternalClient creates a new PaxosClient.

type Request

type Request struct {
	Command epaxospb.Command
	ReturnC chan<- transpb.KVResult
}

Request represents a request to perform a client update. It includes a channel to return the globally ordered result on.

Directories

Path Synopsis
Package transportpb is a generated protocol buffer package.
Package transportpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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