Documentation
¶
Overview ¶
Package singleflight provides a duplicate function call suppression mechanism.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group[V any] interface { Do(ctx context.Context, key string, fn func(context.Context) (V, error)) (v V, shared bool, err error) DoChan(ctx context.Context, key string, fn func(context.Context) (V, error)) <-chan Result[V] Forget(key string) }
Group represents interface for zero time cache.
Example ¶
Output: Shared: true Equal results: true Result: func 1
Click to show internal directories.
Click to hide internal directories.