syncstrategy

package
v1.7.50 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Strategy

type Strategy interface {
	Sync(currentHeight int64, latestHeight int64, worker SyncBlockWorker) ([][]command.Command, SyncedHeight, error)
}

type SyncBlockWorker

type SyncBlockWorker = func(blockHeight int64) ([]command.Command, error)

type SyncedHeight

type SyncedHeight = int64

type Window

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

Simple sync strategy by using a window of n concurrent block syncs at a time

func NewWindow

func NewWindow(logger applogger.Logger, size int) *Window

func (*Window) Sync

func (window *Window) Sync(
	currentHeight int64,
	latestHeight int64,
	worker SyncBlockWorker,
) ([][]command.Command, SyncedHeight, error)

Jump to

Keyboard shortcuts

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