Documentation
¶
Overview ¶
Package progress tells the window how far a long read has got while it runs: the phase under way and how many of the phase's things are done, as an event the caller builds, at most a few times a second. The Release page's list and the worktrees' listing tell theirs through it.
Index ¶
Constants ¶
const Every = 250 * time.Millisecond
Every is how often, at most, a Tracker tells the window: four times a second.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracker ¶
type Tracker[P ~string] struct { // contains filtered or unexported fields }
Tracker tells how far one read has got, as the event its Build makes of the phase under way and its counts. It tells at most once per every; a change that comes sooner waits out the rest of that time, and the changes that come meanwhile go with it, so the window always ends up with the latest counts. Once the read ends, it tells nothing more. A nil Tracker tells nothing, so a read nobody watches passes none. It is safe for concurrent use.
func (*Tracker[P]) Add ¶
Add counts n more of the phase's total done, never past the total. Any goroutine may call it.