dial

package
v0.0.0-...-f672fcd Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 5 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 the implementation for task popping from the min-heap

func (*DialQueue) Wait

func (d *DialQueue) Wait(ctx context.Context) bool

Wait waits for closing or updating event or end of context. Returns true for closing event or end of the context [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