syncx

package
v1.0.0-beta.230 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnceValues

func OnceValues[T1, T2 any](fn func(context.Context) (T1, T2)) func(context.Context) (T1, T2)

OnceValues executes a function at most once and returns the cached result. This function behaves like sync.OnceValues, including caching both return values from the first call, but with a context argument to the function.

Can be used to do lazy database lookups that may be needed by multiple callbacks but should execute at most once.

Types

This section is empty.

Jump to

Keyboard shortcuts

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