MCPcopy
hub / github.com/redis/go-redis / Peek

Method Peek

command.go:5251–5258  ·  view source on GitHub ↗

Peek returns the cached CommandInfo map without triggering a Redis round-trip. Returns nil when the cache is cold; callers should fall back to other heuristics. Note: during the very first Get() (initial population) this call will block on the writer lock. After that, concurrent Peek() calls do not

()

Source from the content-addressed store, hash-verified

5249// the writer lock. After that, concurrent Peek() calls do not block each other.
5250// The returned map and its entries MUST NOT be mutated by the caller.
5251func (c *cmdsInfoCache) Peek() map[string]*CommandInfo {
5252 if c == nil {
5253 return nil
5254 }
5255 c.refreshLock.RLock()
5256 defer c.refreshLock.RUnlock()
5257 return c.cmds
5258}
5259
5260// ------------------------------------------------------------------------------
5261const (

Callers 4

slottedKeyedCommandsMethod · 0.45
cmdInfoPeekMethod · 0.45
readMonitorMethod · 0.45

Calls

no outgoing calls