inflight

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 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 inflight tracks a service's deferred work across Instance Resets (#301). Work started before a Reset must not write into the store the instance resets afterwards: Reset starts a new generation, so work that noted the old one knows to drop itself, and waits for work already running.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

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

Tracker counts running work and the generations Reset starts. The zero value is ready to use.

func (*Tracker) Enter

func (t *Tracker) Enter()

Enter counts work that starts running.

func (*Tracker) Exit

func (t *Tracker) Exit()

Exit uncounts work counted by Enter.

func (*Tracker) Gen

func (t *Tracker) Gen() uint64

Gen returns the current generation.

func (*Tracker) Next

func (t *Tracker) Next()

Next starts a new generation. Callers hold the lock that guards their pending work, so that work either started before Next (and is waited for) or sees the new generation.

func (*Tracker) Wait

func (t *Tracker) Wait(ctx context.Context) error

Wait waits until no work is running, or returns ctx's error when it ends first.

Jump to

Keyboard shortcuts

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