Documentation
¶
Overview ¶
Package stall ends a download that stops sending, and never one that is still moving, however slowly. A wall-clock cap on a whole download failed a slow link part way while its bytes were still coming (#5572: the 83 MB Windows update under ~140 KB/s against 10 minutes).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStalled = errors.New("no data came for a while")
ErrStalled is a download that got no byte for its Watch's while.
Functions ¶
This section is empty.
Types ¶
type Watch ¶
type Watch struct {
// contains filtered or unexported fields
}
Watch is one download's idle timer.
func Start ¶
Start returns a ctx under ctx that ends, its cause ErrStalled, once after goes by with no byte read through w.Reader. The timer runs from now: a server that never answers ends the same way. Stop it when the download is over.
func (*Watch) Err ¶
Err is err, said as a stall (wrapping ErrStalled) when the watch is what ended the download.