rtrefresh

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RtRefreshManager

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

func NewRtRefreshManager

func NewRtRefreshManager(h host.Host, rt *kbucket.RoutingTable, autoRefresh bool,
	refreshKeyGenFnc func(cpl uint) (string, error),
	refreshQueryFnc func(ctx context.Context, key string) error,
	refreshPingFnc func(ctx context.Context, p peer.ID) error,
	refreshQueryTimeout time.Duration,
	refreshInterval time.Duration,
	successfulOutboundQueryGracePeriod time.Duration,
	refreshDoneCh chan struct{}) (*RtRefreshManager, error)

func (*RtRefreshManager) Close

func (r *RtRefreshManager) Close() error

func (*RtRefreshManager) Refresh

func (r *RtRefreshManager) Refresh(force bool) <-chan error

RefreshRoutingTable requests the refresh manager to refresh the Routing Table. If the force parameter is set to true true, all buckets will be refreshed irrespective of when they were last refreshed.

The returned channel will block until the refresh finishes, then yield the error and close. The channel is buffered and safe to ignore.

func (*RtRefreshManager) RefreshNoWait

func (r *RtRefreshManager) RefreshNoWait()

RefreshNoWait requests the refresh manager to refresh the Routing Table. However, it moves on without blocking if it's request can't get through.

func (*RtRefreshManager) Start

func (r *RtRefreshManager) Start()

Jump to

Keyboard shortcuts

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