dial

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 4 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

This section is empty.

Functions

This section is empty.

Types

type DialQueue

type DialQueue struct {
	sync.Mutex
	// contains filtered or unexported fields
}

DialQueue is a queue that holds dials tasks for potential peers, implemented as a min-heap

func NewDialQueue

func NewDialQueue() *DialQueue

NewDialQueue creates a new DialQueue instance

func (*DialQueue) AddTask

func (d *DialQueue) AddTask(
	addrInfo *peer.AddrInfo,
	priority common.DialPriority,
)

AddTask adds a new task to the dial queue

func (*DialQueue) Close

func (d *DialQueue) Close()

Close closes the running DialQueue

func (*DialQueue) DeleteTask

func (d *DialQueue) DeleteTask(peer peer.ID)

DeleteTask deletes a task from the dial queue for the specified peer

func (*DialQueue) Len

func (d *DialQueue) Len() int

PopTask is a loop that handles update and close events [BLOCKING]

func (*DialQueue) PopTask

func (d *DialQueue) PopTask() *DialTask

PopTask is a loop that handles update and close events [BLOCKING]

type DialTask

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

func (*DialTask) GetAddrInfo

func (dt *DialTask) GetAddrInfo() *peer.AddrInfo

GetAddrInfo returns the peer information associated with the dial

Jump to

Keyboard shortcuts

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