sync

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValFn

type ValFn[T any] func() T

func OnceVal

func OnceVal[T any](newFn func() T) ValFn[T]

OnceVal returns a function that invokes f only once and returns the value returned by f. The returned function may be called concurrently.

If f panics, the returned function will panic with the same value on every call.

func OnceValFn

func OnceValFn[T any](newFn func() T) ValFn[T]

OnceValFn returns a function that invokes f only once and returns the value returned by f. The returned function may be called concurrently.

type ValsFn

type ValsFn[T1, T2 any] func() (T1, T2)

func OnceVals

func OnceVals[T1, T2 any](newFn func() (T1, T2)) ValsFn[T1, T2]

OnceVals returns a function that invokes f only once and returns the values returned by f. The returned function may be called concurrently.

If f panics, the returned function will panic with the same value on every call.

func OnceValsFn

func OnceValsFn[T1, T2 any](newFn func() (T1, T2)) ValsFn[T1, T2]

OnceValsFn returns a function that invokes f only once and returns the value returned by f. The returned function may be called concurrently.

Jump to

Keyboard shortcuts

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