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.
Click to show internal directories.
Click to hide internal directories.