scribe

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2014 License: GPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Overview

Package scribe contains a simplified version of Scribe, where no topic based ACLs are defined.

Index

Constants

This section is empty.

Variables

View Source
var ErrSubscribed = errors.New("already subscribed")

Custom topic error messages

Functions

This section is empty.

Types

type Callback

type Callback interface {
	HandlePublish(sender *big.Int, topic string, msg *proto.Message)
	HandleBalance(sender *big.Int, topic string, msg *proto.Message)
	HandleDirect(sender *big.Int, msg *proto.Message)
}

Callback for events leaving the overlay network.

type Overlay

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

The overlay implementation, receiving the overlay events and processing them according to the protocol.

func New

func New(overId string, key *rsa.PrivateKey, app Callback) *Overlay

Creates a new scribe overlay.

func (*Overlay) Balance

func (o *Overlay) Balance(topic string, msg *proto.Message) error

Balances a message to one of the subscribed nodes.

func (*Overlay) Beat

func (o *Overlay) Beat()

Implements the heart.Callback.Beat method. At each heartbeat, the load stats of all the topics are gathered, mapped to destination nodes and sent out. In addition, each root topic sends a subscription message to discover newly added roots.

func (*Overlay) Boot

func (o *Overlay) Boot() (int, error)

Boots the overlay, returning the number of remote peers.

func (*Overlay) Dead

func (o *Overlay) Dead(id *big.Int)

Implements the heat.Callback.Dead method, monitoring the death events of topic member nodes.

func (*Overlay) Deliver

func (o *Overlay) Deliver(msg *proto.Message, key *big.Int)

Implements the pastry.Callback.Deliver method.

func (*Overlay) Direct

func (o *Overlay) Direct(dest *big.Int, msg *proto.Message) error

Sends a direct message to a known node.

func (*Overlay) Forward

func (o *Overlay) Forward(msg *proto.Message, key *big.Int) bool

Implements the pastry.Callback.Forward method.

func (*Overlay) Publish

func (o *Overlay) Publish(topic string, msg *proto.Message) error

Publishes a message into topic to be broadcast to everyone.

func (*Overlay) Shutdown

func (o *Overlay) Shutdown() error

Terminates the overlay and all lower layer network primitives.

func (*Overlay) Subscribe

func (o *Overlay) Subscribe(topic string) error

Subscribes to the specified scribe topic.

func (*Overlay) Unsubscribe

func (o *Overlay) Unsubscribe(topic string) error

Removes the subscription from topic.

Directories

Path Synopsis
Package topic implements a carrier topic tree with functionality to unicast, broadcast and load balance between nodes of the tree.
Package topic implements a carrier topic tree with functionality to unicast, broadcast and load balance between nodes of the tree.

Jump to

Keyboard shortcuts

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