singledo

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 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 Group

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

func (*Group[T]) Do

func (g *Group[T]) Do(key string, fn func() (T, error)) (v T, err error, shared bool)

func (*Group[T]) Forget

func (g *Group[T]) Forget(key string)

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