actsync

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Size:     1000,
	Interval: 5 * time.Second,
}

DefaultConfig is the default configuration

Functions

This section is empty.

Types

type ActionSync

type ActionSync struct {
	lifecycle.Readiness
	// contains filtered or unexported fields
}

ActionSync implements the action syncer

func NewActionSync

func NewActionSync(cfg Config, helper *Helper) *ActionSync

NewActionSync creates a new action syncer

func (*ActionSync) ReceiveAction

func (as *ActionSync) ReceiveAction(_ context.Context, hash hash.Hash256)

ReceiveAction receives an action

func (*ActionSync) RequestAction

func (as *ActionSync) RequestAction(_ context.Context, hash hash.Hash256)

RequestAction requests an action by hash

func (*ActionSync) Start

func (as *ActionSync) Start(ctx context.Context) error

Start starts the action syncer

func (*ActionSync) Stop

func (as *ActionSync) Stop(ctx context.Context) error

Stop stops the action syncer

type Config

type Config struct {
	Size     int           `yaml:"syncSize"`
	Interval time.Duration `yaml:"syncInterval"`
}

Config is the configuration for action syncer

type Helper

type Helper struct {
	P2PNeighbor     Neighbors
	UnicastOutbound UniCastOutbound
}

Helper is the helper for action syncer

type Neighbors

type Neighbors func() ([]peer.AddrInfo, error)

Neighbors acquires p2p neighbors in the network

type UniCastOutbound

type UniCastOutbound func(context.Context, peer.AddrInfo, proto.Message) error

UniCastOutbound sends a unicase message to the peer

Jump to

Keyboard shortcuts

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