timeout

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

timeouts.go implements adaptive timeout management for HTTP requests to Starknet nodes. This file handles dynamic timeout adjustments based on request performance, automatically scaling timeouts up or down depending on success/failure rates.

Index

Constants

View Source
const (
	DefaultTimeouts     = "5s"
	MediumGrowThreshold = 2 * time.Minute
)

Variables

This section is empty.

Functions

func HTTPTimeoutsSettings

func HTTPTimeoutsSettings(w http.ResponseWriter, r *http.Request, clients ...Client)

func ParseTimeouts

func ParseTimeouts(value string) ([]time.Duration, bool, error)

ParseTimeouts parses a comma-separated string of duration values into a slice of time.Duration. Returns: - the parsed timeout values - if a fixed or dynamic timeouts should be used - an error in case the string cannot be parsed

Types

type Client

type Client interface {
	Timeouts() string
	SetTimeouts(timeouts []time.Duration, fixed bool)
}

type Timeouts

type Timeouts struct {
	// contains filtered or unexported fields
}

func Default

func Default() Timeouts

func New

func New(timeouts []time.Duration, fixed bool) *Timeouts

func (*Timeouts) DecreaseTimeout

func (t *Timeouts) DecreaseTimeout()

func (*Timeouts) GetCurrentTimeout

func (t *Timeouts) GetCurrentTimeout() time.Duration

func (*Timeouts) IncreaseTimeout

func (t *Timeouts) IncreaseTimeout()

func (*Timeouts) String

func (t *Timeouts) String() string

Jump to

Keyboard shortcuts

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