requestlane

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 3 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

Package requestlane estimates control-response completion independently of content throughput, transport providers, and operation delivery authority.

Index

Constants

View Source
const (
	InitialResponse = 250 * time.Millisecond
	MinimumResponse = time.Millisecond
	MaximumEstimate = time.Hour
)

Variables

This section is empty.

Functions

func Managed

func Managed(kind protocolsession.MessageKind) bool

Managed excludes streams and negotiations: their lifetime is not a control RTT.

Types

type Call

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

Call owns at most one reservation across proven-unsent admission retries. Its lifetime is independent of trace collection and application response sinks.

func (*Call) Close

func (call *Call) Close()

func (*Call) Complete

func (call *Call) Complete(now time.Time)

func (*Call) Estimate

func (call *Call) Estimate() Estimate

func (*Call) Reserve

func (call *Call) Reserve(reservation *Reservation, estimate Estimate) bool

type Estimate

type Estimate struct {
	Response      time.Duration
	QueuedContent time.Duration
	Expected      time.Duration
	Pending       uint32
}

Estimate records the decision inputs before the new request is reserved.

type Lane

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

Lane belongs to one physical incarnation. Retired reservations may finish on this object but cannot update a replacement lane with the same logical ID.

func New

func New(initial time.Duration) *Lane

New accepts measured latency, including a sub-clock-resolution zero sample. Callers without evidence supply InitialResponse explicitly.

func (*Lane) Estimate

func (lane *Lane) Estimate(kind protocolsession.MessageKind, now time.Time, queued time.Duration) Estimate

func (*Lane) Reserve

func (lane *Lane) Reserve(kind protocolsession.MessageKind, now time.Time) *Reservation

type Reservation

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

Reservation is scheduling accounting only; it never authorizes sends or retries.

func (*Reservation) Abandon

func (reservation *Reservation) Abandon()

Abandon releases accounting without mistaking caller cancellation for a fast response or a transport failure. Repeated settlement is deliberately harmless.

func (*Reservation) Complete

func (reservation *Reservation) Complete(now time.Time)

Complete samples the authenticated final response, before application decoding, disk publication, or caller cleanup can inflate the path's response estimate.

Jump to

Keyboard shortcuts

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