Documentation ¶
Overview ¶
https://stackoverflow.com/questions/40931373/how-to-gc-a-map-of-mutexes-in-go Package mapofmu provides locking per-key. For example, you can acquire a lock for a specific user ID and all other requests for that user ID will block until that entry is unlocked (effectively your work load will be run serially per-user ID), and yet have work for separate user IDs happen concurrently.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type M ¶
type M struct {
// contains filtered or unexported fields
}
M wraps a map of mutexes. Each key locks separately.
type MapOfLimiter ¶
func NewMapOfLimiter ¶
func NewMapOfLimiter() *MapOfLimiter
func (*MapOfLimiter) Allow ¶
func (m *MapOfLimiter) Allow(key interface{}) bool
Click to show internal directories.
Click to hide internal directories.