dial

package
v0.0.0-...-76a5e14 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 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 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) 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