singledo

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result[T any] struct {
	Val T
	Err error
}

type Single

type Single[T any] struct {
	// contains filtered or unexported fields
}

func NewSingle

func NewSingle[T any](wait time.Duration) *Single[T]

func (*Single[T]) Do

func (s *Single[T]) Do(fn func() (T, error)) (v T, err error, shared bool)

Do single.Do likes sync.singleFlight

func (*Single[T]) Reset

func (s *Single[T]) Reset()

Jump to

Keyboard shortcuts

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