wait

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package wait provides functionality for handling waiting and retrying operations.

Index

Constants

This section is empty.

Variables

View Source
var SkipRetry = errors.New("skip retry")

SkipRetry is used as a return value from ForFunc

Functions

func ForFunc added in v0.9.0

func ForFunc(ctx context.Context, timeout time.Duration, f func() error) error

ForFunc waits for function to return non-nil error within the specified timeout. It uses exponential backoff to retry requests until the endpoint responds successfully or the context is canceled.

func ForHTTP

func ForHTTP(ctx context.Context, timeout time.Duration, endpoint string, opts ...func(*http.Request)) error

ForHTTP waits for an HTTP endpoint to become available within the specified timeout. It uses exponential backoff to retry requests until the endpoint responds successfully or the context is canceled.

func ForNATS added in v0.3.0

func ForNATS(ctx context.Context, ns *server.Server, timeout time.Duration) error

ForNATS waits for a NATS server to become ready within the specified timeout. It uses exponential backoff to check the server status until it's available or the context is canceled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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