v1

package
v0.0.0-...-7148df5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr interface {
	// Return a unique identifier (aka. address) for this process
	ID() ProcessID

	// Return the ProcessInbox type for this process
	Type() ProcessType
}

func NewAddress

func NewAddress(id ProcessID, pt ProcessType) Addr

type AddrSet

type AddrSet map[Addr]bool

func (AddrSet) Add

func (a AddrSet) Add(addr Addr)

func (AddrSet) Contains

func (a AddrSet) Contains(addr Addr) bool

func (AddrSet) Len

func (a AddrSet) Len() int

func (AddrSet) Remove

func (a AddrSet) Remove(addr Addr)

type Message

type Message interface {
	// The source Address of this message
	Src() Addr
}

Message - interface intended to be implemented by every message exchanged between Paxos Processes

type MessageExchange

type MessageExchange interface {
	// Send a message to this specific Paxos process identified by its ProcessID
	Send(dest Addr, m Message) error

	// Broadcast a message all Paxos process of a specified type
	SendAll(pt ProcessType, m Message) error

	// Register a process with this exchange
	Register(p ProcessInbox) error

	// UnRegister a process with this exchange
	UnRegister(p ProcessInbox) error
}

MessageExchange - Facilitates message exchanges between Paxos processes.

func NewMessageExchange

func NewMessageExchange() MessageExchange

type Process

type Process interface {
	ProcessInbox
	ProcessOutbox
	GetAddr() Addr
}

Process - interface allowing a runnable entity with message I/O

func NewProcess

func NewProcess(id ProcessID, pt ProcessType) Process

type ProcessID

type ProcessID int

ProcessInbox Identifier in this Paxos system

type ProcessInbox

type ProcessInbox interface {
	// Address of the inbox
	Addr

	// Send a message to this process
	Send(m Message) error
}

ProcessInbox - interface allowing a Paxos process to be addressed & sent messages

type ProcessOutbox

type ProcessOutbox interface {
	// Recv for the next message
	Recv() (Message, error)
}

ProcessOutbox - interface allowing a process to recv messages

type ProcessType

type ProcessType int

ProcessType - The different paxos process types

const (
	Acceptor ProcessType = iota
	Commander
	Leader
	Replica
	Scout
	Client
)

func (ProcessType) String

func (pt ProcessType) String() string

stringer implementation for ProcessType

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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