timeout

package
v0.0.0-...-6cad993 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimedOut = fmt.Errorf("Function call timed out.")
)

Functions

func Run

func Run(fn func() error, timeout time.Duration) error

Run the given function with the given timeout. Return any error returned by the function, or ErrTimedOut if the timeout took place. The function is not interrupted if the timeout takes place.

Types

This section is empty.

Jump to

Keyboard shortcuts

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