Help us shape the future of Go! Take the 2026 Go Developer Survey

faultsequence

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package faultsequence allocates finite, task-private fault steps.

Index

Constants

View Source
const MaxDelayMilliseconds = math.MaxInt64 / int64(time.Millisecond)

Variables

View Source
var ErrExhausted = errors.New("fault sequence exhausted")

Functions

func Delay

func Delay(ctx context.Context, milliseconds int64) error

Delay waits without retaining a reservation lock. Cancellation never resets a step previously allocated by Reserve.

func Reserve

func Reserve(ctx context.Context, dir string, steps int) (int, error)

Reserve consumes one step using exclusive creation in an existing private directory. The directory and step count must stay unchanged until all callers finish. Markers survive process exit, but machine-crash durability is not guaranteed. Concurrent execution order is independent of reservation order. A nonnegative index means consumption occurred, even with an error; -1 means this call allocated no step.

func ValidateDelayMilliseconds

func ValidateDelayMilliseconds(milliseconds int64) error

ValidateDelayMilliseconds checks the source bound without creating a timer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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