pubsub

package
v0.0.0-...-041d6b2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownMessageType = iota
	PrePrepareMessageType
	PrepareMessageType
	CommitMessageType
	NewTxMessageType
	NewBlockMessageType
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(message *PubSubMessage)

type PubSubMessage

type PubSubMessage struct {
	Type    PubSubMessageType
	From    peer.ID `cbor:"-"`
	Payload []byte
}

type PubSubMessageType

type PubSubMessageType int

type PubSubRouter

type PubSubRouter struct {
	Pubsub *pubsub.PubSub
	// contains filtered or unexported fields
}

func NewPubSubRouter

func NewPubSubRouter(h host.Host, ps *pubsub.PubSub, oracleTopic string, isBootstrap bool) *PubSubRouter

func (*PubSubRouter) BroadcastToServiceTopic

func (psr *PubSubRouter) BroadcastToServiceTopic(msg *PubSubMessage) error

func (*PubSubRouter) Hook

func (psr *PubSubRouter) Hook(messageType PubSubMessageType, handler Handler)

func (*PubSubRouter) Run

func (psr *PubSubRouter) Run()

func (*PubSubRouter) Shutdown

func (psr *PubSubRouter) Shutdown()

Jump to

Keyboard shortcuts

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