singledo

package
v0.0.0-...-e89c278 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MPL-2.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[M any] struct {
	Val M
	Err error
}

type Single

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

func NewSingle

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

func (*Single[M]) Do

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

func (*Single[M]) DoFast

func (s *Single[M]) DoFast(fn func() (M, error)) (v M, err error)

func (*Single[M]) DoWithoutCacheOnFail

func (s *Single[M]) DoWithoutCacheOnFail(fn func() (M, error)) (v M, shared bool, err error)

func (*Single[M]) MustDoWithoutCacheOnFail

func (s *Single[M]) MustDoWithoutCacheOnFail(fn func() (M, error)) (v M, shared bool, err error)

func (*Single[M]) Reset

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

Jump to

Keyboard shortcuts

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