link

package
v0.0.0-...-fe73bcc Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2018 License: MIT Imports: 1 Imported by: 6

Documentation

Overview

Package link implements communication link abstraction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message interface {
}

Message defines a serialized message

type Node

type Node interface {
	Members() []Peer        // Returns all the peers including the current node
	Peers() []Peer          // Returns the list of peers of the node
	AddPeer(p Peer)         // Adds a new peer to the peers list
	N() int                 // Returns total number of nodes in the cluster
	Listener() net.Listener // Returns the network listener.

	Peer
}

Node represents a single node in the cluster, at the same time a node itself is a Peer.

type Peer

type Peer interface {
	ID() string     // Returns the ID of the peer
	Addr() net.Addr // Add returns the network address of the node
}

Peer represents a peer in the cluster.

type Perfect

type Perfect interface {
	Send(q Peer, m Message) error    // Requests to send message m to process q
	Deliver(func(p Peer, m Message)) // Delivers message m sent by process p
}

Perfect defines the interface and properties of perfect point-to-point links.

Properties:

PL1: Reliable delivery:
	- If a correct process p sends a message m to a correct process q, then
	  q eventually delivers m.
PL2: No duplication:
	- No message is delivered by a process more than once.
PL3: No creation:
	- If some process q delivers a message m with sender p, then m was
	  previously sent to q by process p.

Directories

Path Synopsis
internal
perfect/test
Package test implements perfect link end to end tests.
Package test implements perfect link end to end tests.
Package node implements link.Node and link.Peer interfaces.
Package node implements link.Node and link.Peer interfaces.
perfect
p2p
Package p2p implements a TCP based perfect peer-to-peer link.
Package p2p implements a TCP based perfect peer-to-peer link.

Jump to

Keyboard shortcuts

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