rtrefresh

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 10 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,
	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. FIXME: this can block. Ideally, we'd return a channel without blocking. https://github.com/libp2p/go-libp2p-kad-dht/issues/609

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() error

Jump to

Keyboard shortcuts

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