dialrace

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package dialrace bounds staggered connection attempts and owns loser cleanup.

Index

Constants

View Source
const Delay = 250 * time.Millisecond

Delay preserves the first candidate's head start before another is tried.

Variables

This section is empty.

Functions

func First

func First[T any](ctx context.Context, count int, dial func(context.Context, int) (T, error), dispose func(T)) (T, int, error)

First tries candidates in order with at most two attempts in flight. A failed attempt advances immediately. dial must honor context cancellation; First cancels and joins every loser before returning the winning value and index. dispose must accept the zero value and release any partially returned value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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