messagequeue

package
v0.0.0-...-15711b3 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2019 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageNetwork

type MessageNetwork interface {
	ConnectTo(context.Context, peer.ID) error
	NewMessageSender(context.Context, peer.ID) (bsnet.MessageSender, error)
}

MessageNetwork is any network that can connect peers and generate a message sender.

type MessageQueue

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

MessageQueue implements queue of want messages to send to peers.

func New

func New(p peer.ID, network MessageNetwork) *MessageQueue

New creats a new MessageQueue.

func (*MessageQueue) AddMessage

func (mq *MessageQueue) AddMessage(entries []*bsmsg.Entry, ses uint64)

AddMessage adds new entries to an outgoing message for a given session.

func (*MessageQueue) RefDecrement

func (mq *MessageQueue) RefDecrement() bool

RefDecrement decrements the refcount for a message queue and returns true if the refcount is now 0.

func (*MessageQueue) RefIncrement

func (mq *MessageQueue) RefIncrement()

RefIncrement increments the refcount for a message queue.

func (*MessageQueue) Shutdown

func (mq *MessageQueue) Shutdown()

Shutdown stops the processing of messages for a message queue.

func (*MessageQueue) Startup

func (mq *MessageQueue) Startup(ctx context.Context, initialEntries []*wantlist.Entry)

Startup starts the processing of messages, and creates an initial message based on the given initial wantlist.

Jump to

Keyboard shortcuts

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