protocol

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages the p2p protocol

func NewManager

func NewManager(cfg *infraconfig.Config, netAdapter *netadapter.NetAdapter, addressManager *addressmanager.AddressManager,
	connectionManager *commanager.ConnectionManager) (*Manager, error)

NewManager creates a new instance of the p2p protocol manager

func (*Manager) Context

func (m *Manager) Context() *flowcontext.FlowContext

func (*Manager) RegisterFlow

func (m *Manager) RegisterFlow(name string, router *routerpkg.Router, messageTypes []appmessage.MessageCommand, isStopping *uint32,
	errChan chan error, initializeFunc common.FlowInitializeFunc) *common.Flow

RegisterFlow registers a flow to the given router.

func (*Manager) RegisterFlowWithCapacity

func (m *Manager) RegisterFlowWithCapacity(name string, capacity int, router *routerpkg.Router,
	messageTypes []appmessage.MessageCommand, isStopping *uint32,
	errChan chan error, initializeFunc common.FlowInitializeFunc) *common.Flow

RegisterFlowWithCapacity registers a flow to the given router with a custom capacity.

func (*Manager) RegisterOneTimeFlow

func (m *Manager) RegisterOneTimeFlow(name string, router *routerpkg.Router, messageTypes []appmessage.MessageCommand,
	isStopping *uint32, stopChan chan error, initializeFunc common.FlowInitializeFunc) *common.Flow

RegisterOneTimeFlow registers a one-time flow (that exits once some operations are done) to the given router.

func (*Manager) SetOnNewBlockTemplateHandler

func (m *Manager) SetOnNewBlockTemplateHandler(onNewBlockTemplateHandler flowcontext.OnNewBlockTemplateHandler)

SetOnNewBlockTemplateHandler sets the onNewBlockTemplate handler

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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