idle

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package idle fails a response body whose reads wait too long for data, so that a stream over a connection that hung ends instead of waiting forever. Client.Stream puts the timeout on the context; the HTTP client of every provider watches the bodies of responses to requests that carry one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Timeout

func Timeout(ctx context.Context) time.Duration

Timeout returns the timeout ctx carries, or zero.

func Watch

func Watch(body io.ReadCloser, timeout time.Duration) io.ReadCloser

Watch returns body, closed once a read has waited timeout for data; that read and every later one then fail. Only waiting counts: a consumer slow to read is not idle.

func WithTimeout

func WithTimeout(ctx context.Context, timeout time.Duration) context.Context

WithTimeout returns ctx carrying timeout for the bodies of the responses to its requests.

Types

This section is empty.

Jump to

Keyboard shortcuts

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