primary

package
v0.0.0-...-bccea44 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

primary implement logic of a primary in VR.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIncomingReq

func AddIncomingReq(req *vrrpc.Request) chan *vrrpc.Response

AddIncomingReq adds a vrrpc.Request to incomingReqs queue.

func Init

func Init(ctx context.Context) error

Init initializes data structures needed for the primary.

func ProcessIncomingReqs

func ProcessIncomingReqs(ctx context.Context)

ProcessIncomingReqs takes requests from incomingReqs queue and processes them. Note: This function is going to be the bottleneck because it has to block for each request. It cannot delegate waiting for backup replies to other threads, because later requests from the same client can reset globals.ClientTable while previous ones are still on the fly. The best solution is to create a per-client incoming request queue. This ensures linearizability.

func RegisterView

func RegisterView(rcvr vrrpc.ViewService) error

RegisterView registers a View RPC receiver.

func RegisterVrgo

func RegisterVrgo(rcvr vrrpc.VrgoService) error

RegisterVrgo registers a Vrgo RPC receiver.

Types

type ClientRequest

type ClientRequest struct {
	Request vrrpc.Request
	// contains filtered or unexported fields
}

ClientRequest represents the in-memory state of a client request in the primary.

type VrgoRPC

type VrgoRPC int

VrgoRPC defines the user RPCs exported by server.

func (*VrgoRPC) Execute

func (v *VrgoRPC) Execute(req *vrrpc.Request, resp *vrrpc.Response) error

Jump to

Keyboard shortcuts

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