util

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockMap

type LockMap[K comparable] interface {
	GetLock(K) *sync.Mutex
}

LockMap provides a mechanism to get a lock for a given key.

func NewExpiringLockMap

func NewExpiringLockMap[K comparable](ctx context.Context, ttl time.Duration) LockMap[K]

NewExpiringLockMap returns a new LockMap that removes entries after the given TTL. Timing of the removal is done in a best-effort fashion, and is not guaranteed to be exact.

Jump to

Keyboard shortcuts

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